-
Notifications
You must be signed in to change notification settings - Fork 54k
BAEL-8530: Introduction to Netty-SocketIO #18722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| private static final Logger LOG = LoggerFactory.getLogger(ServerLiveTest.class); | ||
|
|
||
| @Test | ||
| void startServer() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've written this as a live test, but it's not really a test. It's just a convenient way to run the server code.
|
|
||
| server.start(); | ||
|
|
||
| Thread.currentThread().join(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed otherwise the method immediately ends and the server stops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a sample HTML file that uses the Socket.IO JavaScript library to connect to the server.
| server.addDisconnectListener(client -> { | ||
| LOG.info("Disconnection from client {}", client.getRemoteAddress()); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we demo the client leaving the room here, or that is automatic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's automatic when a client disconnects that they are removed from any rooms they're in. I've mentioned this in the article now.
No description provided.