Package pushy.modules

Examples of pushy.modules.StructModule


        }
    }

    public int getSoLinger()
    {
        StructModule struct_ = (StructModule)client.getModule("struct");
        String result = getsockopt(SocketModule.SOL_SOCKET,
                                   SocketModule.SO_LINGER,
                                   struct_.calcsize("ii"));
        Object[] unpacked = struct_.unpack("ii", result);
        if (unpacked[0].equals(new Integer(0)))
            return -1;
        return ((Number)unpacked[1]).intValue();
    }
View Full Code Here


        return ((Number)unpacked[1]).intValue();
    }

    public void setSoLinger(boolean on, int linger)
    {
        StructModule struct_ = (StructModule)client.getModule("struct");
        setsockopt(SocketModule.SOL_SOCKET, SocketModule.SO_LINGER,
            struct_.pack("ii", new Object[]{
                new Integer(on ? 1 : 0), new Integer(linger)}));
    }
View Full Code Here

TOP

Related Classes of pushy.modules.StructModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.