Exemplo n.º 1
0
        }//end of public virtual void OnConnected(IPAddress address, ushort port)

        /// <summary>
        /// Used To When An Existing Connection Is Offline
        /// </summary>
        /// <param name="address"></param>
        /// <param name="port"></param>
        public virtual void OnDisconnected(IPAddress address, ushort port)
        {
            Guard.Null(address, nameof(address), $"Cannot Fire 'OnConnected' Event, Supplied IP Address Is NULL!");
            Guard.AssertTrue(port.IsValidPortRange(), $"Cannot Fire 'OnConnected' Event, Supplied Port '{port}' Is Not Valid!");

            ConnectionMethod = ConnectionType.Disconnected;

            OnDisconnectedEvent?.Invoke(this, new ConnectDisconnectEvent(false, address, port));
        }//end of public virtual void OnDisconnected(IPAddress address, ushort port)
Exemplo n.º 2
0
 private void procDisConnect(NetworkMgr.QueuePack pack)
 {
     OnDisConnected?.Invoke(pack.ClientID, null);
 }