Skip to content

Conversation

@Paul-Andre
Copy link
Contributor

This has to do with: https://github.com/cyderize/rust-websocket/issues/81

I added a set_nonblocking method to the Server so it is possible to make accepting connections not block, and added a set_nonblocking method to Receiver<WebSocketStream> so it is possible to make receiving messages not block.

Documentation, examples and tests still need to be written.

@Paul-Andre Paul-Andre mentioned this pull request Jul 11, 2016
@illegalprime
Copy link
Collaborator

Thanks for the PR!
I think it would make sense to add this to the sender as well. This would be useful whenever you would only want to send the freshest data (and be on one thread): you would want to gather data, check if you can send it, if not dump it and gather new data.

I can't really do anything official here since I don't have any write permissions, but @cyderize should be around soon.

@Paul-Andre
Copy link
Contributor Author

Paul-Andre commented Jul 11, 2016

Ok. Do you think I should expose these methods directly from the Client?

By the way, in what situations would sending block?

@illegalprime
Copy link
Collaborator

Thanks for the edits again! I'm under the impression that sending would block if the TCP stream (or similar) isn't ready to be written to yet: because the OS buffer for outgoing packets is full for example.

@cyderize
Copy link
Member

@Paul-Andre, @illegalprime this looks good to me.

If you could rebase this to squash all the commits into a single one that would be great.

Thanks for this

@illegalprime
Copy link
Collaborator

@Paul-Andre thanks again!

@illegalprime illegalprime merged commit 105d8b8 into websockets-rs:master Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants