Exemplo n.º 1
0
 /// <summary>
 /// 关闭Socket回调
 /// </summary>
 /// <param name="type"></param>
 /// <param name="state"></param>
 /// <param name="socketCode"></param>
 /// <param name="socketMessage"></param>
 private void CloseSocket(CloseType type, Exception e = null)
 {
     //关闭套接字
     socket.Close();
     logger.Log("断开TCP成功!");
     //引发断线事件
     if (onCloseSocket != null)
     {
         onCloseSocket(type, currentState, e);
     }
 }
Exemplo n.º 2
0
 //停止连接
 public void Stop()
 {
     currentState = SocketState.CLOSE;
     try
     {
         //关闭套接字
         socket.Close();
         isClose = true;
         logger.Log("断开UDP成功!");
     }
     catch (Exception exp)
     {
         //引发错误事件
         CallError(exp);
     }
 }
Exemplo n.º 3
0
 void Start()
 {
     Audio.OnLoad.Subscribe(_ => IDebuger.Log("OnLoad Subscribe!"));
 }