Reputation: 92
My .NET MAUI application communicates with a server using a tcpconenction. However, if the user turns his phone off or minimizes the application for a few minutes and then reopens it, the connection is closed. I though about checking if the Stream is not null, else opening a new connection, but is there a way to stop NetworkStreams from closing due to inactivity?
Upvotes: 0
Views: 42
Reputation: 1
To maintain the connection, you can use a keep-alive mechanism
Upvotes: 0