-
Notifications
You must be signed in to change notification settings - Fork 634
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
Why luasocket client:send
send 0 (zero) byte but return 1?
#409
Comments
If this happens, then that would be a bug. In that case the question comes up; what would the proper return value be? Possible values I can think of;
imho the third option would be preferred If you can create a PR, that would be very much appreciated. |
btw; this only applies to |
This documentation doesn't tell about "return 0 to indicate it send nothing". Maybe this doc should be reconsider and make improvement. |
And, the While I write my own tcp proto. I found the socket never close because I doesn't triggered "io.close". The reason I found was that Not every time remote After all, I found the best way is to check if Those received data was the To avoid remote closed is not only checking But there is a problem. In some low quality(QOS) network Wifi. If indicating remote is closed by check So I think this My means is that this framework is awful. How |
And there is another bug. Sometimes a client is already After doing some network read write and close. Sometimes I see remote socket was I've read the source code but found nothing strange. So why this closed remote socket was being I don't understand when This remote is already closed. why being accept again. Why Oh ho~ my god! Is the |
please do not mix issues or bugs in a single github issue. |
If
client:send
sends 0 byte within buffer[i, j].But it returns the
last index
between [i, j]. So return value is within [1, j]Which describe in document:
And
But what if
client:send
had send1
one byte.How to destinct the return value of
client:send
after send 1 byte and send 0 byte?For example,
But network is not good.
Or Linux socket queue is full.
Or Windows socket buffer is full.
So It doesn't send anymore buffers.
The text was updated successfully, but these errors were encountered: