public void Dispose() { try { Handle.Shutdown(SocketShutdown.Both); Handle.Close(); } catch (Exception ex) { SysLogger.Log(ex.Message, SysLogType.Error); } this.Connection = null; this.Properties = null; this.Handle = null; this.Server = null; this.clientHS = null; this.serverHS = null; if (this.KeepAliveTimer != null) { this.KeepAliveTimer.Enabled = false; } this.IsDisposed = true; try { onDisconnect(DisconnectReason.UserDisconnection); } catch (Exception ex) { SysLogger.Log(ex.Message, SysLogType.Error); } }
public void Dispose() { try { Handle.Shutdown(SocketShutdown.Both); Handle.Close(); } catch (Exception ex) { SysLogger.Log(ex.Message, SysLogType.Error); } this.Connection = null; this.Properties = null; this.Handle = null; this.Server = null; this.clientHS = null; this.serverHS = null; if(this.KeepAliveTimer != null) this.KeepAliveTimer.Enabled = false; this.IsDisposed = true; try { onDisconnect(DisconnectReason.UserDisconnection); } catch (Exception ex) { SysLogger.Log(ex.Message, SysLogType.Error); } }