public void SendKeepAliveData()
{
if (!_parent.IsClosed) {
// Note:
// Disconnecting or Closing socket may happen before Send() is called.
// In such case, SocketException or ObjectDisposedException will be thrown in Send().
// We just ignore the exceptions.
try {
_connection.SendIgnorableData("keep alive");
}
catch (SocketException) {
}
catch (ObjectDisposedException) {
}
}
}