Skip to content

请问怎么返回socket.onerror的异常到connnect.tsx #457

Answered by yume-chan
FickXu asked this question in Q&A
Discussion options

You must be logged in to vote

Can't understand what you want to do.

When the WebSocket connection is established, the Promise will be resolved. A settled Promise can't switch to other states anymore.

If server closes the WebSocket connection first, only close event will fire, and the listener for that event will close both the readable and writable streams. connect.tsx knows this because the pipe chain will stop and device.disconnected will be resolved.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@FickXu
Comment options

@yume-chan
Comment options

@FickXu
Comment options

Answer selected by yume-chan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants