Code example for ServerSocketChannel

Methods: acceptsocketclose

0
         */ 
        protected SourceChannelImpl(SelectorProvider provider)
                throws IOException { 
            super(provider);
            sourceServer = provider.openServerSocketChannel();
            sourceServer.socket().bind(
                new InetSocketAddress(InetAddress.getByName(null), 0));
            serverPort = sourceServer.socket().getLocalPort();
        } 
 
        void closeServer() throws IOException { 
            sourceServer.close();
        } 
 
        void accept() throws IOException { 
            sourceSocket = (SocketChannelImpl) sourceServer.accept();
        } 
 
        protected void implCloseSelectableChannel() throws IOException { 
            sourceSocket.close();
        } 
Contextual code suggestions in your IDE  Get Codota for Java