Threaded server doesn't run its threads

Christian Ullrich chris at chrullrich.de
Sun Jan 14 16:50:35 EST 2001


Hello all!

I am writing a small server to remotely control (run and monitor) an
application. Because this is my first encounter with networks, I
decided to use Python, as it appears to be rather easy to use.

Now I am facing a problem in the implementation. My server is supposed
to run the app and monitor its output, and at the same time respond to
status queries, so I think I can't let the MyRequestHandler block.

I read a bit about select, but i did not understand it, and I want to
get some working code in the _near_ future. So I chose the
ThreadingTCPServer.

But it doesn't work. The server script starts and runs. When I telnet
to the port, I get a connection, but no response from the server
(MyRequestHandler.handle() seems not to be called). If I now Ctrl-C
the server script, handle() is called, but if I enter a command via
telnet, the script simply terminates, rather than handling the
command, as it's supposed to do.

The same code, just using TCPServer instead of ThreadingTCPServer,
does not show this behavior, the forking server works fine as well.

I am using Python 2.0 on Linux, but it fails similarly on NT.

Might there be a problem with the underlying OS support?

Because this post is already quite long, I am not including example
source. If you need it, please tell me.

-- 
Christian Ullrich		     Registrierter Linux-User #125183

"Sie können nach R'ed'mond fliegen -- aber Sie werden sterben"



More information about the Python-list mailing list