-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[wasm] WebSocket improve send/receive buffers #58199
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue Details
Fixes #44614
|
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
|
Right now it doesn't handle all the abort/cancelation/dispose scenarios. Work in progress ... stay tuned :-D |
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
|
I tested with Chrome, Edge and Firefox locally. |
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
|
Why does this PR remove Add/RemoveEventListener? |
Because we don't need it anymore. Do you think that it should be part of the public API going forward ? |
|
The implementation in the PR right now is running unit test suite 5x slower than main branch. It's caused by blocking send operation until the buffer is empty. We had chat with @kg and here are conclusions
Edit: this is all done now |
904ff9d to
69c9d8d
Compare
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
471df1c to
0d5b8cc
Compare
b7d988b to
8ae4eff
Compare
kg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than comments (you don't need to fix all of them)
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
...System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs
Outdated
Show resolved
Hide resolved
e55169c to
9ac01e4
Compare
|
Test failures are unrelated |
9ac01e4 to
f60ddfe
Compare
|
Notes I made during code walkthrough with @CarnaViire
|
....Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Runtime.cs
Outdated
Show resolved
Hide resolved
|
Follow up on yesterday conversation with @CarnaViire about CloseOutput from client side. So, we are losing the messages from server after The alternative is to not call |
Hm, this is a huge failure on browser vendors' part. I don't like the data loss here. Is there some way we could signal this behavior difference to the developer? |
|
The other differences in behavior are
|
We agreed with @kg to issue warning into console once per app lifetime. |
- CC0 notice for JavaScript queue - feedback
297996c to
bc060b1
Compare
bufferedAmount === 0BrowserWebSocketwould throw on any subsequent operations, except "close".The previous
BrowserWebSocketimplementation did following actions, which the proposed implementation doesn't doSendAsyncdidn't block task onendOfMessagefor large pending transmissionCloseOutputAsyncself produced onClose message for it's receiversConnectAsyncsent "close" message to server and self produced onClose message for it's receivers, when canceledReceiveAsyncsent "close" message to server , when canceledFixes #44614
Fixes #58202
Makes #57519 to just report slow test to console instead of fail.
Makes #53957 to just report slow test to console instead of fail.
Fixes #58031