public void listenerCallback( IAsyncResult result ) { log.Trace( "net.server.listenerCallback()" ); // TODO: not sure where we should put the call to start listening // for the next connection, here for now this.tcpServer.BeginAcceptTcpClient( listenerCallback, null ); TcpClient client = this.tcpServer.EndAcceptTcpClient( result ); NetStream stream = new NetStream( client.GetStream(), Env ); Server.instance.queueWorkItem( new Callback { callback = raiseConnectionEvent, args = new object[]{ stream } } ); // kick off async read stream.read(); }
public void listenerCallback(IAsyncResult result) { log.Trace("net.server.listenerCallback()"); // TODO: not sure where we should put the call to start listening // for the next connection, here for now this.tcpServer.BeginAcceptTcpClient(listenerCallback, null); TcpClient client = this.tcpServer.EndAcceptTcpClient(result); NetStream stream = new NetStream(client.GetStream(), Env); Server.instance.queueWorkItem(new Callback { callback = raiseConnectionEvent, args = new object[] { stream } }); // kick off async read stream.read(); }