예제 #1
0
 public void CloseNotCallback()
 {
     Connection    -= new ConnectionOk(OnTcpIPClientConnected);
     DataOn        -= new DataOn(OnTcpIPClientReceived);
     Disconnection -= new ExceptionDisconnection(OnTcpIPClientDisconnected);
     TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CHintType.Intro, "[NetworkClose]:Nothing"));
     base.Close();
     mConnected = false;
 }
예제 #2
0
 public override void Close()
 {
     //if (null != mSendMessageThread)
     //{
     //    mSendMessageThread.Abort();
     //    mSendMessageThread = null;
     //    while (TcpIPMessageQueue.DequeueSend() != null) ;
     //}
     TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CHintType.Intro, "[NetworkClose]:Nothing"));
     base.Close();
     mConnected     = false;
     Connection    -= new ConnectionOk(OnTcpIPClientConnected);
     DataOn        -= new DataOn(OnTcpIPClientReceived);
     Disconnection -= new ExceptionDisconnection(OnTcpIPClientDisconnected);
 }
예제 #3
0
 void OnTcpIPClientConnected(string message, bool IsConn)
 {
     mConnected = IsConn;
     if (IsConn)
     {
         TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CHintType.Intro, "[OnTcpIPClientConnected1]" + message));
         //mSendMessageThread = new Thread(new ParameterizedThreadStart(SendMessageThreading));
         //mSendMessageThread.Start(this);
     }
     else
     {
         TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CHintType.Intro, "[ff0000][OnTcpIPClientConnected2]" + message));
         TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CHintType.Error, message));
     }
 }
예제 #4
0
 void OnTcpIPClientDisconnected(string message)
 {
     //if (null != mSendMessageThread)
     //{
     //    mSendMessageThread.Abort();
     //    mSendMessageThread = null;
     //    while (TcpIPMessageQueue.DequeueSend() != null) ;
     //}
     mConnected = false;
     //if (LocalPlayer.Inst.InLoginState)
     //    TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CPromptMode.Intro信息, "[OnTcpIPClientDisconnected]" + message));
     //else
     TcpIPMessageQueue.EnqueueRecv(S2C_Hint.Builder(S2CHintType.Error, message));
     if (null != OnDisConnected)
     {
         OnDisConnected(message);
     }
 }