Code example for SocketChannel

Methods: isOpen

0
		this.key = key;
	} 
 
	public boolean isAlive() { 
		SocketChannel channel = (SocketChannel) key.channel();
		return channel.isOpen();
	} 
 
	public void resume() { 
		key.interestOps(SelectionKey.OP_WRITE);
 
	} 
 
	public void pause() { 
		key.interestOps(SelectionKey.OP_READ);
	} 
 
	public void stop() { 
		ChannelProcessor channelProcessor = (ChannelProcessor) key.attachment();
		channelProcessor.close(key);
	}