Exemplo n.º 1
0
 /// <summary>
 /// Removes the listener.
 /// </summary>
 /// <param name="eventCode">The event code.</param>
 /// <param name="socketListener">The socket listener.</param>
 public void RemoveListener(EventCode eventCode, IGSocketListener socketListener)
 {
     if (mSocketDictionary.TryGetValue(eventCode, out var eventHandler))
     {
         eventHandler.RemoveListener(socketListener);
     }
 }
Exemplo n.º 2
0
            /// <summary>
            /// Removes the listener.
            /// </summary>
            /// <param name="socketListener">The socket listener.</param>
            public void RemoveListener(IGSocketListener socketListener)
            {
                bool isSuccess = _listenerList.Remove(socketListener);

                if (!isSuccess)
                {
                    Console.WriteLine("移除IGSocketListener失敗");
                }
            }
Exemplo n.º 3
0
 /// <summary>
 /// Adds the listener.
 /// </summary>
 /// <param name="eventCode">The event code.</param>
 /// <param name="socketListener">The socket listener.</param>
 public void AddListener(EventCode eventCode, IGSocketListener socketListener)
 {
     if (mSocketDictionary.TryGetValue(eventCode, out var eventHandler))
     {
         eventHandler.AddListener(socketListener);
     }
     else
     {
         Console.WriteLine("於GSocket中並未定義該Event:" + eventCode);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds the listener.
 /// </summary>
 /// <param name="socketListener">The socket listener.</param>
 public void AddListener(IGSocketListener socketListener)
 {
     _listenerList.Add(socketListener);
 }