protected override sealed void OnConnected( ClientSocketAsyncEventArgs e ) { Contract.Assert( e != null ); var tuple = e.UserToken as Tuple<Socket, Action<RpcClient, object>, object>; Contract.Assert( tuple != null ); base.OnConnectedCore( e, tuple.Item2, tuple.Item3 ); }
protected override sealed void ConnectCore( ClientSocketAsyncEventArgs context, Action<ClientSocketAsyncEventArgs, object> callerOnConnected, object asyncState ) { context.UserToken = Tuple.Create( context, callerOnConnected, asyncState ); bool dummy; this._connectingQueue.Add( context, this._cancellationTokenSource.Token, out dummy ); }