Websocket implementation

Issue #1 resolved
PhilippeM created an issue

Hello Peter, First congrats for your project, it looks really nice. The approach you took seems to be the most scalable of the ones I have seen up to now.

I was wondering why you chose to implement from scratch the WS protocol instead of relying on existing ones like Netty for example. Wouldn't it make it easier for you to maintain library ?

Thanks

Comments (2)

  1. Peter Doornbosch repo owner

    Hi Philippe,

    Thanks for the feedback. Nice to hear from people finding it useful.

    Before i started this project, i tried a few websocket client libraries. I don't recall exactly which i tried, but certainly more than one. All of the ones i tried created a number of threads for each client (connection) created (some even created a surprisingly large number of threads for each client). Of course, this harms scalability, as the number of threads that can be created in one JVM is limited. For the tests that i was planning, i needed as much concurrent clients/threads as possible. After browsing through the websocket specification, i thought that it wouldn't be that hard to write a simple (but functional) websocket client that did not create any thread at all. And thus far, i'm pretty happy with the result. And of course, i enjoyed writing it.

    You're right that this way, i don't benefit from the work of others and my implementation might contain bugs that other libraries never had or already have fixed. But the fact that this implementation 100% matches my primary design goal (everything done on caller's thread) and is simple and thus easy to understand, is important to me. Also, i tested it against several server implementations (none of which i wrote myself ;-)) so i'm pretty confident its quality is ok. Still, if you find a bug, i'd like to know and i certainly will (try to) fix it.

    Regards, Peter

  2. Log in to comment