public class TioServer extends Object
| Constructor and Description |
|---|
TioServer(int port,
TioServerConfig serverConfig) |
TioServer(Node serverNode,
TioServerConfig serverConfig) |
TioServer(String ip,
int port,
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() |
boolean |
stop() |
public TioServer(int port,
TioServerConfig serverConfig)
public TioServer(String ip, int port, TioServerConfig serverConfig)
public TioServer(Node serverNode, TioServerConfig serverConfig)
public 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()
throws IOException
IOExceptionpublic boolean stop()
Copyright © 2025. All rights reserved.