Code example for SocketChannel

Methods: isBlocking, read

0
                throw new AlreadyConnectedException();
            } 
            super.connect(remoteAddr, timeout);
            channel.localAddress = networkSystem.getSocketLocalAddress(channel.fd);
            if (super.isConnected()) { 
                channel.setConnected();
                channel.isBound = super.isBound();
            } 
        } 
 
        /** 
         * @see java.net.Socket#bind(java.net.SocketAddress) 
         */ 
        @Override 
        public void bind(SocketAddress localAddr) throws IOException {
            if (channel.isConnected()) {
                throw new AlreadyConnectedException();
            } 
            if (SocketChannelImpl.SOCKET_STATUS_PENDING == channel.status) {
                throw new ConnectionPendingException();
            }