Examples of socket()


Examples of java.nio.channels.SocketChannel.socket()

            if(localHost == null) {
                InetSocketAddress addr = new InetSocketAddress(InetAddress.getByName(remoteHost), remotePort);
                channel = SocketChannel.open(addr);
            } else {
                channel = SocketChannel.open();
                Socket socket = channel.socket();
                socket.bind(new InetSocketAddress(InetAddress.getByName(localHost), localPort));
                socket.connect(new InetSocketAddress(InetAddress.getByName(remoteHost), remotePort));
            }
            channel.finishConnect();
            initSocket(context.getRuntime(), new ChannelDescriptor(channel, RubyIO.getNewFileno(), new ModeFlags(ModeFlags.RDWR), new FileDescriptor()));
View Full Code Here

Examples of java.nio.channels.SocketChannel.socket()

        return socketChannel;
    }
   
    private void dispatchTranslatedData(IRandomAccessDataBuffer randomAccessDataBuffer, int dataId) throws IOException{
        SocketChannel socketChannel =  openDataTransferChane();
        Socket socket = socketChannel.socket();
        try {
            DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
            dos.writeInt(dataId);
            long len = randomAccessDataBuffer.length();
            if(randomAccessDataBuffer.transferTo(0, len , socketChannel)!=len){
View Full Code Here

Examples of jnr.unixsocket.UnixServerSocketChannel.socket()

        UnixServerSocketChannel channel = UnixServerSocketChannel.open();

        try {
            Selector sel = NativeSelectorProvider.getInstance().openSelector();
            channel.configureBlocking(false);
            channel.socket().bind(address);
            channel.register(sel, SelectionKey.OP_ACCEPT, new ServerActor(channel, sel));

            while (sel.select() > 0) {
                Set<SelectionKey> keys = sel.selectedKeys();
                for (SelectionKey k : keys) {
View Full Code Here

Examples of org.apache.yoko.orb.OCI.IIOP.TransportInfo_impl.socket()

    public void receive_request_service_contexts(ServerRequestInfo ri) {
        ServerRequestInfoExt riExt = (ServerRequestInfoExt) ri;
        TransportInfo_impl connection = (TransportInfo_impl)riExt.getTransportInfo();
        if (connection != null) {
            Socket socket = connection.socket();
            if (socket != null) {
                System.out.println("Retrieved socket successfully");
                return;
            }
        }
View Full Code Here

Examples of org.jeromq.ZMQ.Context.socket()

    final Context context = ZMQ.context(threads);
    Socket sender;

    if (PUBSUB.equals(socketType)) {
      LogLog.debug("Setting socket type to PUB");
      sender = context.socket(ZMQ.PUB);
    }
    else if (PUSHPULL.equals(socketType))
    {
      LogLog.debug("Setting socket type to PUSH");
      sender = context.socket(ZMQ.PUSH);
View Full Code Here

Examples of org.zeromq.ZMQ.Context.socket()

        }
    }
    @Test
    public void testPollerUnregister() {
        Context context = ZMQ.context(1);
        Socket socketOne = context.socket(ZMQ.SUB);
        Socket socketTwo = context.socket(ZMQ.REP);
        Poller poller = new ZMQ.Poller(2);
        poller.register(socketOne, ZMQ.Poller.POLLIN);
        poller.register(socketTwo, ZMQ.Poller.POLLIN);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.