I've found a library named tokio-serde which will send and receive data using tokio tcp socket and serialize and deserialize that using serde json.
There is two examples which will show how you can create a server and a client using this lib.
In this example you can see how to send data using serialized
object.
serialized
.send(json!({...}));
https://github.com/carllerche/tokio-serde/blob/master/examples/client.rs
So I've created a server app and stored serialized
objects in a vector to send them messages later.
But for any reason, these connections can be disconnected and peer client may not be available.
Here my problem is how can I detect when a client is disconnected, using serialized
object ?
I've searched through documentation but couldn't find any solution.
Any help is really appreciated. Thank you so much.