public OutputStreamContext(ConnectionContext connectionContext)
 {
     this.connectionContext = connectionContext;
 }
Exemplo n.º 2
0
 public void BeginRead(ConnectionContext connectionContext)
 {
     InputStreamContext ctx = new InputStreamContext(connectionContext, bufferSize);
     ctx.ConnectionContext.ClientStream.BeginRead(ctx.Header, 0, sizeof(long), BeginReadCallback, ctx);
 }
Exemplo n.º 3
0
        private void BeginAcceptSocketCallback(IAsyncResult result)
        {
            Log.LogMessage("Received socket connection");

            TcpListener tcpListener = (TcpListener)result.AsyncState;
            TcpClient tcpClient = tcpListener.EndAcceptTcpClient(result);
            NetworkStream clientStream = tcpClient.GetStream();

            ConnectionContext ctx = new ConnectionContext(clientStream, ConnString, this);
            ctx.StartProcessingInputQueue();
            BeginRead(ctx);

            tcpListener.BeginAcceptTcpClient(BeginAcceptSocketCallback, tcpListener);
        }
 public InputStreamContext(ConnectionContext connectionContext, int bufferSize)
 {
     this.connectionContext = connectionContext;
     this.buffer = new byte[bufferSize];
 }