Skip to content

restart socket io server fail #687

@levou

Description

@levou

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions