コード例 #1
0
 public OutputStreamContext(ConnectionContext connectionContext)
 {
     this.connectionContext = connectionContext;
 }
コード例 #2
0
 public void BeginRead(ConnectionContext connectionContext)
 {
     InputStreamContext ctx = new InputStreamContext(connectionContext, bufferSize);
     ctx.ConnectionContext.ClientStream.BeginRead(ctx.Header, 0, sizeof(long) + sizeof(int), BeginReadCallback, ctx);
 }
コード例 #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, Log);
            ctx.StartProcessingInputQueue();
            BeginRead(ctx);

            tcpListener.BeginAcceptTcpClient(BeginAcceptSocketCallback, tcpListener);
        }
コード例 #4
0
 public InputStreamContext(ConnectionContext connectionContext, int bufferSize)
 {
     this.connectionContext = connectionContext;
     this.buffer = new byte[bufferSize];
 }