newbie question about SocketServer

A

akameswaran

Is it just me or do the server_close() methods do squat? I'm primarily
working with a ThreadingTCPServer object and trying to create a simple
server that can shut itself down. But even simplest cases don't seem
to work.

Admittedly I am trying it from within my handler class, but for some
odd reason, the server is allways willing to handle one more request
before dying. Then it dies.
 
S

Steve Horsley

Is it just me or do the server_close() methods do squat? I'm primarily
working with a ThreadingTCPServer object and trying to create a simple
server that can shut itself down. But even simplest cases don't seem
to work.

Admittedly I am trying it from within my handler class, but for some
odd reason, the server is allways willing to handle one more request
before dying. Then it dies.

I suspect that the server thread itself is stuck in
socket.accept(), and won't exit until the next call arrives. Try
calling server_close and then making a brief connection to the
server to wake it up.

HTH
Steve
 
A

akameswaran

After further playing - it seems that the server_close() just takes
time to execute. I have found that if I wait a while (1-3 seconds) the
second connection will fail as well. Locking is already built into my
handler class - so I'll just use it to prevent further connections
until server_close() completes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top