Improve handling of disconnects and reconnects (#228)

* Check response 0 on disconnect

From recv(): The return value will be 0 when the peer has performed an orderly shutdown

* Add persistent presence and handlers

* Use buffer instead of raw struct

* Clear presence data on shutdown

* Remove CurrentPresence and add boolean instead

This removes the need for having 2 big buffers in favor of using a small boolean
This commit is contained in:
Florian Spieß
2018-11-16 19:41:49 +01:00
committed by Mason Sciotti
parent 98855b4d84
commit dd47c7c66d
2 changed files with 13 additions and 6 deletions

View File

@ -118,5 +118,8 @@ bool BaseConnection::Read(void* data, size_t length)
}
Close();
}
else if (res == 0) {
Close();
}
return res == (int)length;
}