Examples of socket()


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

      SocketChannel  channel = getSocketChannel();
     
      channel.socket().setSendBufferSize( size_in_bytes );
      channel.socket().setReceiveBufferSize( size_in_bytes );
     
      int snd_real = channel.socket().getSendBufferSize();
      int rcv_real = channel.socket().getReceiveBufferSize();
     
      if (Logger.isEnabled())
        Logger.log(new LogEvent(LOGID, "Setting new transport [" + description
          + "] buffer sizes: SND=" + size_in_bytes + " [" + snd_real
View Full Code Here

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

     
      channel.socket().setSendBufferSize( size_in_bytes );
      channel.socket().setReceiveBufferSize( size_in_bytes );
     
      int snd_real = channel.socket().getSendBufferSize();
      int rcv_real = channel.socket().getReceiveBufferSize();
     
      if (Logger.isEnabled())
        Logger.log(new LogEvent(LOGID, "Setting new transport [" + description
          + "] buffer sizes: SND=" + size_in_bytes + " [" + snd_real
          + "] , RCV=" + size_in_bytes + " [" + rcv_real + "]"));
View Full Code Here

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

        public void run() {
            try {
                while (true) {
                    SocketChannel socket = serverSocket.accept();
                    InetSocketAddress remoteAddress = (InetSocketAddress) socket.socket().getRemoteSocketAddress();
                    if (!localAddresses.contains(remoteAddress.getAddress())) {
                        LOGGER.error("Cannot accept connection from remote address {}.", remoteAddress.getAddress());
                    }
                    URI remoteUri = new URI(String.format("tcp://localhost:%d", remoteAddress.getPort()));
                    LOGGER.debug("Accepted connection from {}.", remoteUri);
View Full Code Here

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

                    LOGGER.debug("Cannot connect to address {}, skipping.", address);
                    lastFailure = e;
                    continue;
                }
                LOGGER.debug("Connected to address {}.", address);
                URI localAddress = new URI(String.format("tcp://localhost:%d", socketChannel.socket().getLocalPort()));
                return new SocketConnection<T>(socketChannel, localAddress, destinationUri, classLoader);
            }
            throw lastFailure;
        } catch (java.net.ConnectException e) {
            throw new ConnectException(String.format("Could not connect to server %s. Tried addresses: %s.",
View Full Code Here

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

        SocketChannel channel = null;
        Socket socket = null;
        final OutputStream out;
        try {
            channel = SocketChannel.open();
            socket = channel.socket();
            socket.connect(dstSockAddr);
            out = socket.getOutputStream();
        } catch (IOException e) {
            LOG.error("failed to connect: " + dstSockAddr, e);
            IOUtils.closeQuietly(channel);
View Full Code Here

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

        SocketChannel channel = null;
        Socket socket = null;
        final OutputStream out;
        try {
            channel = SocketChannel.open();
            socket = channel.socket();
            socket.connect(dstSockAddr);
            out = socket.getOutputStream();
        } catch (IOException e) {
            LOG.error("failed to connect: " + dstSockAddr, e);
            IOUtils.closeQuietly(channel);
View Full Code Here

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

      try{       
        SocketChannel socket_channel = ssc.accept();
           
        successfull_accepts++;
       
        if ( !( allow_external_access || socket_channel.socket().getInetAddress().isLoopbackAddress())){
         
          if (Logger.isEnabled())
            Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                "AEProxy: incoming connection from '"
                    + socket_channel.socket().getInetAddress()
View Full Code Here

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

        if ( !( allow_external_access || socket_channel.socket().getInetAddress().isLoopbackAddress())){
         
          if (Logger.isEnabled())
            Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                "AEProxy: incoming connection from '"
                    + socket_channel.socket().getInetAddress()
                    + "' - closed as not local"));
       
          socket_channel.close();
         
        }else{
View Full Code Here

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

                            // a little bit paranoia
                            if ( cChannel != null )
                            {
                                // little bit tuning
                                cChannel.socket().setTrafficClass( EJConstants.IPTOS_THROUGHPUT );
                                cChannel.socket().setReuseAddress( true );
                                cChannel.socket().setSoLinger( false, 0 );
                               
                                // ensure that the socket channel is prepared
                                // for non-blocking operations
View Full Code Here

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

                            // a little bit paranoia
                            if ( cChannel != null )
                            {
                                // little bit tuning
                                cChannel.socket().setTrafficClass( EJConstants.IPTOS_THROUGHPUT );
                                cChannel.socket().setReuseAddress( true );
                                cChannel.socket().setSoLinger( false, 0 );
                               
                                // ensure that the socket channel is prepared
                                // for non-blocking operations
                                cChannel.configureBlocking( false );
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.