public class TioServer extends Object
| Constructor and Description |
|---|
TioServer(TioServerConfig serverConfig) |
| Modifier and Type | Method and Description |
|---|---|
TioServerConfig |
getServerConfig() |
Node |
getServerNode() |
AsynchronousServerSocketChannel |
getServerSocketChannel() |
boolean |
isWaitingStop() |
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)
添加定时任务,注意:如果抛出异常,会终止后续任务,请自行处理异常
|
void |
start(String serverIp,
int serverPort) |
boolean |
stop() |
public TioServer(TioServerConfig serverConfig)
serverConfig - TioServerConfigpublic TioServerConfig getServerConfig()
public Node getServerNode()
public AsynchronousServerSocketChannel getServerSocketChannel()
public boolean isWaitingStop()
public 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 void start(String serverIp, int serverPort) throws IOException
IOExceptionpublic boolean stop()
Copyright © 2024. All rights reserved.