iconnmanager.java
来自「一个实用工具类」· Java 代码 · 共 78 行
JAVA
78 行
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file. */package org.butor.socket.nio;import java.nio.channels.SelectableChannel;/** * Interface to implements by a connection manager. * This connection manager facilitate the usage of sockets for reading, accepting * and writing. Client channel register with this manager to be notified when the * channel is ready for the appropriate operation. * * @author sawanai * Feb 10, 2005 */public interface IConnManager { /** * To register with the manager. * * @param channel * @param handler */ void registerWithSelector(SelectableChannel channel, IConnHandler handler); /** * To register with the manager. * * @param channel */ void unregisterWithSelector(SelectableChannel channel); /** * To register with the manager for writing. * Used when the client had somthing to write. * * @param channel */ void wantWrite(SelectableChannel channel); /** * To unregister with the manager for writing. * Used when the client had nothing to write. * * @param channel */ void removeWrite(SelectableChannel channel); /** * To register with the manager for reading. * Used when the client want to read. * * @param channel */ void wantRead(SelectableChannel channel); /** * To unregister with the manager for reading. * Used when the client does not interested to read. * * @param channel */ void removeRead(SelectableChannel channel); /** * To register with the manager for accepting incoming connections. * Used when the client want to handle new incoming connections. * * @param channel */ void wantAccept(SelectableChannel channel); /** * To register with the manager for accepting incoming connections. * Used when the client want to cancel handling of new incoming connections. * * @param channel */ void removeAccept(SelectableChannel channel);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?