/// <summary> /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the /// appropriate reply messages. /// </summary> /// <remarks> /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the /// appropriate reply messages. Control in the calling thread immediately /// returns after the handler thread has been created. /// <p>For every incomming TCP/IP connection a handler thread is created /// to handle ONC/RPC calls on this particular connection. /// </remarks> public override void listen() { // // Create a new (daemon) thread which will handle incoming connection // requests. // _TransportHelper t = new _TransportHelper(this); Thread listenThread = new Thread(new ThreadStart(t.run)); listenThread.Name = "TCP server transport listener thread"; // // Now wait for (new) connection requests to come in. // // // Let the newly created transport object handle this // connection. Note that it will create its own // thread for handling. // // // We are just ignoring most of the IOExceptions as // they might be thrown, for instance, if a client // attempts a connection and resets it before it is // pulled off by accept(). If the socket has been // gone away after an IOException this means that the // transport has been closed, so we end this thread // gracefully. // listenThread.Start(); }
/// <summary> /// Creates a new thread and uses this thread to handle the new connection /// to receive ONC/RPC requests, then dispatching them and finally sending /// back reply messages. /// </summary> /// <remarks> /// Creates a new thread and uses this thread to handle the new connection /// to receive ONC/RPC requests, then dispatching them and finally sending /// back reply messages. Control in the calling thread immediately /// returns after the handler thread has been created. /// <p>Currently only one call after the other is dispatched, so no /// multithreading is done when receiving multiple calls. Instead, later /// calls have to wait for the current call to finish before they are /// handled. /// </remarks> public override void listen() { _TransportHelper t = new _TransportHelper(this); Thread listener = new Thread(new ThreadStart(t.run)); listener.Name = "TCP server transport connection thread"; // Should be a Daemon thread if possible //listener.setDaemon(true); listener.Start(); }
/// <summary> /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the /// appropriate reply messages. /// </summary> /// <remarks> /// Creates a new thread and uses this thread to listen to incoming /// ONC/RPC requests, then dispatches them and finally sends back the /// appropriate reply messages. Control in the calling thread immediately /// returns after the handler thread has been created. /// <p>Currently only one call after the other is dispatched, so no /// multithreading is done when receiving multiple calls. Instead, later /// calls have to wait for the current call to finish before they are /// handled. /// </remarks> public override void listen() { _TransportHelper t = new _TransportHelper(this); _listener = new Thread(new ThreadStart(t.run)); _listener.Name = "UDP server transport listener thread"; // Should be a Daemon //listener.setDaemon(true); _listener.Start(); }