Threaded server doesn't run its threads 
Author Message
 Threaded server doesn't run its threads

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"



Fri, 04 Jul 2003 05:50:35 GMT  
 Threaded server doesn't run its threads

Quote:
> 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.

I tried it on two more machines, one Linux, one NT, there it
all works just fine. I'm confused now.

Quote:
> Might there be a problem with the underlying OS support?

Now I think this is the probable cause. Could someone please
list the required software to get thread support working?

Thank you.

Sent via Deja.com
http://www.deja.com/



Fri, 04 Jul 2003 18:12:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Thread#kill doesn't kill processes inside a thread

2. Threads in Python version 1.5, thread doesn't start until calling process dies

3. Tcl_Finalize doesn't clean-up running threads

4. Threads creating threads creating threads...

5. thread, threading, mutex modules and non-threading interpreters

6. Thread#join doesn't accept a timeout?

7. FSU threads, Provenzano's threads, and python

8. Threaded build doesn't work on IRIX 6.5

9. tkdesk on fedora core 5 -- doesn't run, doesn't compile

10. Non-threaded function in a threaded recursion?

11. Thread.new vs. Thread.start

12. meditations on threads and thread safety

 

 
Powered by phpBB® Forum Software