-
Notifications
You must be signed in to change notification settings - Fork 280
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 usrsctp_sendv sometimes returns EWOULDBLOCK after connection has established? #142
Comments
|
I enlarge the SO_SNDBUF once an EWOULDBLOCK received (up to 2^28). But the EWOULDBLOCK keeps showing at the almost same frequency (serveral minutes) as before. So maybe it's not due to my send buffer size. Though I do not care about a little data loss, but the error is annoying and the TCP connection is OK. |
Subscribe |
In non-blocking mode, you will always have to handle If you don't want to handle |
We've been using "SCTP_SENDER_DRY_EVENT" instead of send_cb. Will this make a significant difference? |
The send_cb is fired if there is there is some room in the send buffer (controlled by the threshold provided). If you use the |
So it's possible in cases with, say, lots of packet loss, that relying on SCTP_SENDER_DRY_EVENT could harm our throughput immensely? Wow, I can't believe we've been doing it wrong all this time. It's a wonder why the thousands of WebRTC data channel users didn't notice (until now). |
In case of packetloss, you wait until everything has been retransmitted successfully, before the |
@tuexen: Wouldn't it also hurt in case of no packet loss? When a reliable transmission occurs, the data needs to be acknowledged before the send buffer can be considered completely empty, correct? So, throughput is decreased because the implementation waits for an ack. Then, subsequent data is copied into the buffer and only then sending can start again. |
@taylor-b I'm assuming you're talking about the Chrome codebase for WebRTC data channels? Unless something has changed in the code, Again, unless something has changed, the |
@lgrahl Right... So it alternates between completely filling up the buffer and completely draining it. Agree it seems like a problem. |
@lgrahl I think additionally to what you stated, by only listening to |
I think the discussion has finished. If not, re-open. |
Too late but what is the default sending buffer size value? |
256K. |
Thanks |
262144 Bytes. Can be changed like in https://github.com/sctplab/usrsctp/blob/master/programs/ekr_loop.c#L494. |
Let me ask this question here, since I think it follows the thread. Does the If so, this can be used as the Is that correct? |
Yes. And However, |
It makes sense that, in Chrome, an extra buffer layer is used when there is no enough space in usrsctp. Good to see that Thanks |
Since you say that it will eventually do it.., Is there any estimated time for this implementation? On the other hand, I see that I see that adding such argument to the callback would be feasible by just taking the same argument value for both callbacks from @tuexen and company, I believe that adding the |
BTW: I could do the PR for adding the |
The only problem I have with the change is that it breaks backwards compatibility.... But maybe it is worth breaking it. |
Any suggestion on how to overcome such change in the code? Is there any similar update that is not backwards compatible so I can have a look? Like defining one or another signature depending on the version, etc. |
@taylor-b Didn't you also suggest the adding of the The good point is that compilers will detect the change... |
That for sure :-) |
PR: #511 |
It's already implemented; what I meant by "eventually" is that it may take additional time for the WebRTC-level buffer to be drained. Imagine that bufferedAmountLowThreshold is set to 1KB and 200KB is buffered. WebRTC might attempt to send additional messages, only to run into EWOULDBLOCK again before
It does provide the |
Oh, I misunderstood you, thanks for the clarification. |
|
The non_blocking mode is set to true. The usrsctp_sendv sometimes returns EWOULDBLOCK after the SCTP_COMM_UP event. And this keep appearing during the video data transimission. Though the data transmission is not stop due to this error, I want to know what causes an EWOULDBLOCK on sending. Does this mean the program sends the data too fast?
The text was updated successfully, but these errors were encountered: