-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
restart project(may kill project process ID and then start), it's fail.
see log ,c.c.socketio.SocketIOServer - SocketIO server start failed at port:xxxx
but not any about real reason.
ps: added shutdown hook and spring bean destory call stop method.
{
starter();
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@OverRide
public void run() {
stop();
}
}));
}
socketio config:
SocketConfig socketConfig = new SocketConfig();
socketConfig.setTcpNoDelay(true);
socketConfig.setSoLinger(0);
socketConfig.setReuseAddress(true);
com.corundumstudio.socketio.Configuration config = new
com.corundumstudio.socketio.Configuration();
config.setSocketConfig(socketConfig);
config.setHostname(IPModel.IP.localIP());
config.setPort(socketIOConfig.getPort());
config.setBossThreads(socketIOConfig.getBossCount());
config.setWorkerThreads(socketIOConfig.getWorkCount());
config.setAllowCustomRequests(socketIOConfig.isAllowCustomRequests());
config.setUpgradeTimeout(socketIOConfig.getUpgradeTimeout());
config.setPingTimeout(socketIOConfig.getPingTimeout());
config.setPingInterval(socketIOConfig.getPingInterval());