Archive

Posts Tagged ‘Network programming’

C++ WebSocket server – Source-Code released

Hey folks,

I open sourced my C++ WebSocket Server implementation. It is a pretty basic C++11 server running on POSIX/MacOSX systems. It supports the most recent WebSocket implementation and works fine with Chrome/Safari and Firefox. Windows is not supported on purpose.

It was an awesome learning process to write it and I learned so much about HTML etc, that I can suggest for anyone who is interested in low level network programming to do the same.

The server supports MYSQL, JSON and runs on multiple threads. So quite cool 🙂

The read loop is not yet finished tho.. If you for example stream a big video file, the current thread will be blocked until it is received. That is a no-go and i am working on fixing it!

The runloop is based on select (shame on me i know) and uses the same principle NodeJS uses for example. One steady loop with event callbacks.

Check it out:

https://github.com/MarkusPfundstein/C—Websocket-Server