Server Instance
Creating a Server
Configuration config = new Configuration();
config.setHostname("localhost");
config.setPort(9092);
SocketIOServer server = new SocketIOServer(config);Starting the Server
server.start()server.startAsync().addListener(future -> {
if (future.isSuccess()) {
System.out.println("Server started on " + config.getPort());
} else {
System.out.println("Error " + future.cause().getLocalizedMessage());
}
});Stopping the Server
server.stop();Complete Example
Notes
Last updated
Was this helpful?