Пример #1
0
        /// <summary>
        /// Called when the remote client disconnects.
        /// </summary>
        protected virtual void OnDisconnect(SocketDisconnectReason disconnectReason)
        {
            _receiving = false;             //no longer reading.

            if (SocketDisconnected != null)
            {
                Log.Info(_id + ": Firing SocketDisconnected event. Reason is " + disconnectReason.ToString());
                //SocketDisconnected(this, new SocketDisconnectedEventArgs(_connectDate, DateTime.Now));
                GU.EventHelper.FireAsync(SocketDisconnected, this, new SocketDisconnectedEventArgs(disconnectReason, _connectDate, DateTime.Now));
            }
        }
		/// <summary>
		/// buffer
		/// </summary>
		/// <param name="startReadDate">Date this socket was connected and started receiving data.</param>
		public SocketDisconnectedEventArgs(SocketDisconnectReason reason, DateTime connectDate, DateTime disconnectDate) : base() 
		{
			_reason = reason;
			_connectDate = connectDate;
			_disconnectDate = disconnectDate;
		}
		/// <summary>
		/// Called when the remote client disconnects.
		/// </summary>
		protected virtual void OnDisconnect(SocketDisconnectReason disconnectReason)
		{
			_receiving = false; //no longer reading.

			if(SocketDisconnected != null)
			{
				Log.Info(_id + ": Firing SocketDisconnected event. Reason is " + disconnectReason.ToString());
				//SocketDisconnected(this, new SocketDisconnectedEventArgs(_connectDate, DateTime.Now));
				GU.EventHelper.FireAsync(SocketDisconnected, this, new SocketDisconnectedEventArgs(disconnectReason, _connectDate, DateTime.Now));
			}
		}
Пример #4
0
 /// <summary>
 /// buffer
 /// </summary>
 /// <param name="startReadDate">Date this socket was connected and started receiving data.</param>
 public SocketDisconnectedEventArgs(SocketDisconnectReason reason, DateTime connectDate, DateTime disconnectDate) : base()
 {
     _reason         = reason;
     _connectDate    = connectDate;
     _disconnectDate = disconnectDate;
 }