com.zusmart.base.network.ChannelContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zusmart-base Show documentation
Show all versions of zusmart-base Show documentation
提供基础的工具类及方法类,Logging,Scanner,Buffer,NetWork,Future,Thread
package com.zusmart.base.network;
import java.io.IOException;
import java.nio.channels.Selector;
import com.zusmart.base.network.handler.ChannelContextHandlerChain;
import com.zusmart.base.network.message.Message;
import com.zusmart.base.network.message.MessageFuture;
import com.zusmart.base.toolkit.NetAddress;
public interface ChannelContext {
public long getRegistTime();
public long getActiveTime();
public long getReaderActiveTime();
public long getWriterActiveTime();
public long getReaderDataTotal();
public long getWriterDataTotal();
public long getReaderDataCount();
public long getWriterDataCount();
public boolean isOpen();
public boolean isServerSide();
public boolean isClientSide();
public String getContextCode();
public NetAddress getServerAddress();
public NetAddress getClientAddress();
public ChannelContextFuture close();
public ChannelContextFuture flush();
public MessageFuture write(Message message);
public MessageFuture writeAndFlush(Message message);
public ChannelContextHandlerChain getChannelContextHandlerChain();
///////////////////////////////////////////////////////////////////////////
public void doRegister(Selector selector)throws IOException;
public void doListener(int events)throws IOException;
public void deRegister();
public void doException(Throwable cause);
public void doTimeout();
public void doReadable()throws IOException;
public void doWritable()throws IOException;
}