If two peers connect and one disconnects, the other won't necessarily know.
Alex and Charlie connect. Alex sees that they are connected to 1 device.
Charlie disconnects from wifi. Alex still sees a connection to 1 device, even though the connection should be broken.
We can fix this in several ways. I think the best is to enable TCP keepalive, which effectively sends a packet every second asking, "is this connection still on?".
I did not add unit tests for this (I could not think of a good way) but did test manually in CoMapeo with two Android devices.
If two peers connect and one disconnects, the other won't necessarily know.
We can fix this in several ways. I think the best is to enable TCP keepalive, which effectively sends a packet every second asking, "is this connection still on?".
I did not add unit tests for this (I could not think of a good way) but did test manually in CoMapeo with two Android devices.