tomaka / rouille

Web framework in Rust
Apache License 2.0
1.09k stars 105 forks source link

How to disconnect a websocket from rouille? #184

Open foresthan opened 6 years ago

foresthan commented 6 years ago

I am wondering if there is a close method for rouille::websocket::Websocket struct to close a websocket from server side.

gwbres commented 2 years ago

@foresthan, once you call upgrade() upon clients request to open a websocket, you should spawn a thread where the special stream handler lives on. If this thread gets terminated, it is my understanding that the websocket is terminated

hrh858 commented 6 months ago

Is it just me or there isn't an easy way to sen a closing frame to the client from the server before terminating the thread?