/// <summary>
 ///		Initializes a new instance of the <see cref="MessageContext"/> class.
 /// </summary>
 protected MessageContext()
 {
     this._socketContext           = new SocketAsyncEventArgs();
     this._socketContext.UserToken = this;
     this._timeoutWatcher          = new TimeoutWatcher();
     this._timeoutWatcher.Timeout += (sender, e) => this.OnTimeout();
 }
Example #2
0
 /// <summary>
 ///		Initializes a new instance of the <see cref="MessageContext"/> class.
 /// </summary>
 protected MessageContext()
 {
     SocketContext = new SocketAsyncEventArgs {
         UserToken = this
     };
     timeoutWatcher          = new TimeoutWatcher();
     timeoutWatcher.Timeout += (sender, e) => OnTimeout();
 }
            public DefaultConnectTimeoutWatcher(TimeSpan timeout, Action onTimeout)
            {
                var watcher = new TimeoutWatcher();

                watcher.Timeout += (sender, e) => onTimeout();
                Interlocked.Exchange(ref this._watcher, watcher);
                watcher.Start(timeout);
            }
Example #4
0
		/// <summary>
		///		Initializes a new instance of the <see cref="MessageContext"/> class.
		/// </summary>
		protected MessageContext()
		{
			this._socketContext = new SocketAsyncEventArgs();
			this._socketContext.UserToken = this;
			this._timeoutWatcher = new TimeoutWatcher();
			this._timeoutWatcher.Timeout += ( sender, e ) => this.OnTimeout();
		}
Example #5
0
			public DefaultConnectTimeoutWatcher( TimeSpan timeout, Action onTimeout )
			{
				var watcher = new TimeoutWatcher();
				watcher.Timeout += ( sender, e ) => onTimeout();
				Interlocked.Exchange( ref this._watcher, watcher );
				watcher.Start( timeout );
			}