public class TioClient extends Object
| Constructor and Description |
|---|
TioClient(TioClientConfig tioClientConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncConnect(Node serverNode)
asyncConnect
|
void |
asyncConnect(Node serverNode,
Integer timeout)
asyncConnect
|
void |
asyncConnect(Node serverNode,
String bindIp,
Integer bindPort,
Integer timeout)
asyncConnect
|
ClientChannelContext |
connect(Node serverNode)
connect
|
ClientChannelContext |
connect(Node serverNode,
Integer timeout)
connect
|
ClientChannelContext |
connect(Node serverNode,
String bindIp,
Integer bindPort,
ClientChannelContext initClientChannelContext,
Integer timeout)
connect
|
ClientChannelContext |
connect(Node serverNode,
String bindIp,
Integer bindPort,
Integer timeout) |
AsynchronousChannelGroup |
getChannelGroup() |
TioClientConfig |
getClientConfig() |
TimerTaskService |
getTaskService()
getTaskService
|
TioClientConfig |
getTioClientConfig()
Deprecated.
|
void |
reconnect(ClientChannelContext channelContext,
Integer timeout) |
TimerTask |
schedule(Runnable command,
long delay)
添加定时任务,注意:如果抛出异常,会终止后续任务,请自行处理异常
|
TimerTask |
schedule(Runnable command,
long delay,
Executor executor)
添加定时任务,注意:如果抛出异常,会终止后续任务,请自行处理异常
|
TimerTask |
scheduleOnce(Runnable command,
long delay)
添加定时任务
|
TimerTask |
scheduleOnce(Runnable command,
long delay,
Executor executor)
添加定时任务
|
boolean |
stop()
停止
|
public TioClient(TioClientConfig tioClientConfig) throws IOException
tioClientConfig - TioClientConfigIOException - IOExceptionpublic void asyncConnect(Node serverNode) throws Exception
serverNode - serverNodeException - Exceptionpublic void asyncConnect(Node serverNode, Integer timeout) throws Exception
serverNode - serverNodetimeout - timeoutException - Exceptionpublic void asyncConnect(Node serverNode, String bindIp, Integer bindPort, Integer timeout) throws Exception
serverNode - serverNodebindIp - bindIpbindPort - bindPorttimeout - timeoutException - Exceptionpublic ClientChannelContext connect(Node serverNode) throws Exception
serverNode - serverNodeException - Exceptionpublic ClientChannelContext connect(Node serverNode, Integer timeout) throws Exception
serverNode - serverNodetimeout - timeoutException - Exceptionpublic ClientChannelContext connect(Node serverNode, String bindIp, Integer bindPort, ClientChannelContext initClientChannelContext, Integer timeout) throws Exception
serverNode - serverNodebindIp - bindIpbindPort - bindPortinitClientChannelContext - initClientChannelContexttimeout - 超时时间,单位秒Exception - Exceptionpublic ClientChannelContext connect(Node serverNode, String bindIp, Integer bindPort, Integer timeout) throws Exception
serverNode - NodebindIp - bindIpbindPort - bindPorttimeout - 超时时间,单位秒Exception - Exceptionpublic AsynchronousChannelGroup getChannelGroup()
public TioClientConfig getClientConfig()
@Deprecated public TioClientConfig getTioClientConfig()
public TimerTaskService getTaskService()
public void reconnect(ClientChannelContext channelContext, Integer timeout) throws Exception
channelContext - ClientChannelContexttimeout - 单位秒Exception - Exceptionpublic TimerTask schedule(Runnable command, long delay)
command - runnabledelay - delaypublic TimerTask schedule(Runnable command, long delay, Executor executor)
command - runnabledelay - delayexecutor - 用于自定义线程池,处理耗时业务public TimerTask scheduleOnce(Runnable command, long delay)
command - runnabledelay - delaypublic TimerTask scheduleOnce(Runnable command, long delay, Executor executor)
command - runnabledelay - delayexecutor - 用于自定义线程池,处理耗时业务public boolean stop()
Copyright © 2025. All rights reserved.