Saturday, March 17, 2012

Added WebSocket support to the server

I added my java WebSocket implementation to my server. I now have the base class ClientConnection which handles my JSON-based protocol on the application layer, and the two specialized subclasses ClientConnectionSocket and ClientConnectionWebSocket which handle the string-based data exchange with the client using vanilla sockets and WebSockets respectively.

That way I won't have to worry (much) about making sure that any given feature works in both network stacks. It will also allow me to easily add other ways to connect to my server, like an UDP-based or flashbridge-based network stack.

Here a screenshot of a simple command-line based client executing the login sequence via WebSocket:


Now there is no excuse anymore not to port the client from WinJS to normal Javascript.

No comments:

Post a Comment