disccord icon indicating copy to clipboard operation
disccord copied to clipboard

WebSocket support

Open FiniteReality opened this issue 8 years ago • 2 comments

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

FiniteReality avatar Dec 22 '16 21:12 FiniteReality

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.

abuneri avatar Feb 28 '17 23:02 abuneri

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.

FiniteReality avatar Mar 01 '17 08:03 FiniteReality