/// <summary> /// /// </summary> /// <param name="exSocket"></param> /// <param name="opCode"></param> /// <param name="reason"></param> protected void Dispose(ExSocket exSocket, sbyte opCode, string reason) { try { var e = new SocketEventArgs() { Socket = exSocket, Source = new DataMeaage() { OpCode = opCode, Message = reason } }; DoClosed(e); OnDisconnected(e); if (exSocket != null) { exSocket.Close(); } sendEventArg.Dispose(); receiveEventArg.Dispose(); receiveWaitEvent.Dispose(); socketClient.Dispose(); } catch (Exception ex) { TraceLog.WriteError("Dispose connect of client error:{0}", ex); } }
/// <summary> /// /// </summary> /// <param name="exSocket"></param> /// <param name="opCode"></param> /// <param name="reason"></param> protected void Dispose(ExSocket exSocket, sbyte opCode, string reason) { try { var e = new SocketEventArgs() { Socket = exSocket, Source = new DataMeaage() { OpCode = opCode, Message = reason } }; DoClosed(e); OnDisconnected(e); exSocket.Close(); } catch (Exception ex) { logger.Error("OnDisconnected", ex); } }
/// <summary> /// /// </summary> /// <param name="exSocket"></param> /// <param name="opCode"></param> /// <param name="reason"></param> protected void Dispose(ExSocket exSocket, sbyte opCode, string reason) { try { var e = new SocketEventArgs() { Socket = exSocket, Source = new DataMeaage() { OpCode = opCode, Message = reason } }; DoClosed(e); OnDisconnected(e); if (exSocket != null) exSocket.Close(); } catch (Exception ex) { TraceLog.WriteError("Dispose connect of client error:{0}", ex); } }
/// <summary> /// /// </summary> /// <param name="exSocket"></param> /// <param name="opCode"></param> /// <param name="reason"></param> protected void Dispose(ExSocket exSocket, sbyte opCode, string reason) { try { var e = new SocketEventArgs() { Socket = exSocket, Source = new DataMeaage() { OpCode = opCode, Message = reason } }; DoClosed(e); OnDisconnected(e); exSocket.Close(); } catch (Exception ex) { logger.Error("OnDisconnected", ex); } }