Package pushy.modules

Examples of pushy.modules.SocketModule


        assertEquals(true, socket.getTcpNoDelay());
    }

    public void testTrafficClass() throws IOException
    {
        SocketModule module = (SocketModule)client.getModule("socket");
        int iptos_throughput = 0xe0; // IPTOS_CLASS_CS7
        socket.setTrafficClass(iptos_throughput);
        assertEquals(iptos_throughput, socket.getTrafficClass());
    }
View Full Code Here


    {
        if (!isConnected())
            throw new SocketException("Socket is not connected");
        if (!isInputShutdown)
        {
            SocketModule module = (SocketModule)client.getModule("socket");
            PushyObject shutdown = (PushyObject)object.__getattr__("shutdown");
            Object SHUT_WR = module.__getattr__("SHUT_WR");
            shutdown.__call__(new Object[]{SHUT_WR});
            if (inputStream != null)
                inputStream.close();
            inputStream = null;
            isInputShutdown = true;
View Full Code Here

    {
        if (!isConnected())
            throw new SocketException("Socket is not connected");
        if (!isOutputShutdown)
        {
            SocketModule module = (SocketModule)client.getModule("socket");
            PushyObject shutdown = (PushyObject)object.__getattr__("shutdown");
            Object SHUT_WR = module.__getattr__("SHUT_RD");
            shutdown.__call__(new Object[]{SHUT_WR});
            isOutputShutdown = true;
        }
    }
View Full Code Here

            synchronized (this) {
                if (getsockopt == null)
                    getsockopt = (PushyObject)object.__getattr__("getsockopt");
            }
        }
        SocketModule module = (SocketModule)client.getModule("socket");
        Integer level = module.getConstant(level_);
        Integer option = module.getConstant(option_);
        Object result = getsockopt.__call__(new Object[] {level, option});
        return ((Number)result).intValue();
    }
View Full Code Here

            synchronized (this) {
                if (getsockopt == null)
                    getsockopt = (PushyObject)object.__getattr__("getsockopt");
            }
        }
        SocketModule module = (SocketModule)client.getModule("socket");
        Integer level = module.getConstant(level_);
        Integer option = module.getConstant(option_);
        Object result = getsockopt.__call__(
            new Object[]{level, option, new Integer(buflen)});
        return (String)result;
    }
View Full Code Here

            synchronized (this) {
                if (setsockopt == null)
                    setsockopt = (PushyObject)object.__getattr__("setsockopt");
            }
        }
        SocketModule module = (SocketModule)client.getModule("socket");
        Integer level = module.getConstant(level_);
        Integer option = module.getConstant(option_);
        setsockopt.__call__(new Object[] {level, option, value});
    }
View Full Code Here

        super(getInetAddress(client, hostname), port);
    }

    private static InetAddress getInetAddress(Client client, String hostname)
    {
        SocketModule socket = (SocketModule)client.getModule("socket");
        try
        {
            return InetAddress.getByName(socket.getHostByName(hostname));
        }
        catch (java.net.UnknownHostException e)
        {
            // This shouldn't occur: passing an IP into getByName will just
            // validate the format of the IP.
View Full Code Here

TOP

Related Classes of pushy.modules.SocketModule

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.