-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to check if all data sent #305
Comments
in my opinion, you no need to care about |
Hello @nskforward! So there are generally no write errors on which it makes sense to retry in Go. First, you might get an error because you cannot write to the socket anymore. The peer may have explicitly disconnected, the peer may not be responding or some operating system limit may have been exceeded. It doesn't make sense to retry here as the connection is effectively unsable in some way and your application should release the associated resources. Second, a deadline may have been triggered. Here you could retry but it doesn't make much sense. If a deadline was triggered, then the peer is too slow to receive your messages. Rather than retrying, why not just make your write deadline longer? If you're using a small deadline to do some sort of polling in your write goroutine then you'd be misusing Go as the purpose of goroutines and IO built into the runtime is to avoid you having to do that kind of stuff manually. It might make sense to write an error in a multistream protocol where you could use a different stream to let the peer know they're being disconnected for being too slow but WebSockets is unfortunately not such a protocol. But regardless, with this library you currently don't have the choice to retry as the API exposed to us by See #242 |
Apologies for the delayed response! |
In write.go file function Write does not return the number of actually sent bytes.
So currently I cannot do the second assertion in code below:
The text was updated successfully, but these errors were encountered: