Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
 /// <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);
     }
 }
Exemple #3
0
        /// <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);
            }

        }
Exemple #4
0
        /// <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);
            }

        }