Tauri Websocket Plugin V1 #10096
-
I am intending to use tauri websocket plugin V1 for creating ws client and maintain it using rust process. I am using reactjs as frontend, and use websocket plugin api for communicating with the websocket. Now i saw there are four functions,
Now in my js i have a wrapper class that when the UI starts, i create a ws connection and keep it, all my components use this to send and listen message fron server. Now, my question is if for some reason the ws connection get disconnected (for network issue, or server stops) etc. How i know it? there is no onClose function or something. When the connection close, does my ws variable (where i kept the ws connection, is automatically updated to null or something?) I mean how i know that ws got disconnected? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It seems like the TypeScript type is incorrect but the websocket listener should also report errors. For more or less expected disconnects there's also a Close message. tbh this didn't see much testing so we're not quite sure either... |
Beta Was this translation helpful? Give feedback.
It seems like the TypeScript type is incorrect but the websocket listener should also report errors. For more or less expected disconnects there's also a Close message.
tbh this didn't see much testing so we're not quite sure either...