housleyjk / ws-rs

Lightweight, event-driven WebSockets for Rust.
MIT License
1.46k stars 219 forks source link

Any example to seperate out sender and receiver? #323

Open rohitcelestial opened 4 years ago

rohitcelestial commented 4 years ago

I am looking for examples for seperating out the senders and receivers such that I shall be able to write to socket from file and then receive message and save them seperately.

Thanks.

d4h0 commented 4 years ago

@rohitcelestial: Did you see this guide?

It seems you can send Sender to another thread and then send messages from that thread. Because ws.rs is callback-based, the callback you defined will still receive new messages.

It seems there is a bug when the WebSocket was closed and further messages are sent: https://github.com/housleyjk/ws-rs/issues/316