ping_discover_network icon indicating copy to clipboard operation
ping_discover_network copied to clipboard

flush and close the connection

Open HelloBytes opened this issue 4 years ago • 0 comments

In some occasions on some devices, when you scan the network and after it's done connect to that device on the same port the connection is not closed properly.

My proposal is to add flush and close before destroy:

final Socket s = await Socket.connect(host, port, timeout: timeout); await s.flush(); await s.close(); s.destroy();

HelloBytes avatar Dec 15 '20 10:12 HelloBytes