disccord
disccord copied to clipboard
WebSocket support
This issue will be used to track the status of the websocket client.
- [x] Connection logic
- [ ] Heartbeat logic
- [x] Receive gateway events
- [ ] IDENTIFY logic
Flowchart for reference: http://i.imgur.com/Wy5wbGq.png
Right now it looks like we are just using going to use the regular web::websockets::client::websocket_client
, however; I highly recommend that we use web::websockets::client::websocket_callback_client
since it is specifically made for applications that want to maintain a connection host for a long time. If we just use websocket_client
, then we will have to make our own event loop for the receive
method, which is tricky as well because we may miss messages that way. But instead of receive, websocket_callback_client
has a method set_message_handler which does all that work for us, and receives every incoming message, its quite nice.
I was planning on doing something like Discord.Net, which uses an event-based websocket client.
On 28 Feb 2017 23:05, "Ashton Tito" [email protected] wrote:
Right now it looks like we are just using going to use the regular web::websockets::client::websocket_client, however; I highly recommend that we use web::websockets::client::websocket_callback_client since it is specifically made for applications that want to maintain a connection host for a long time. If we just use websocket_client, then we will have to make our own event loop for the receive method, which is tricky as well because we may miss messages that way. But instead of receive, websocket_callback_client has a method set_message_handler which does all that work for us, and receives every incoming message, its quite nice.