Code example for ServerSocketChannel

Methods: register

0
			InetSocketAddress address = new InetSocketAddress(port);
			ss.bind(address);
			this.ssc = ssc;
			logger.debug("Starting mainLoop()");
			selector = Selector.open();
			ssc.register(selector, SelectionKey.OP_ACCEPT);
 
		} catch (IOException e) {
			throw new RuntimeException(e);
		} 
 
	} 
 
	public void enqueue(Object event) {
		// Check connections one time 
		logger.debug("Entering enqueue");
		EventForTcpServer e = (EventForTcpServer) event;
		e.visit(this);
		logger.debug("Exiting enqueue");
	}