blocking socket dilemma

Gumuz gumuz at looze.net
Wed Sep 11 04:58:54 EDT 2002


Hi all,

I am a little bit stuck with my design (again!).

I have this server class, which creates a session object for every accepted
incoming connection. The session object has a RequestHandler function which
is then run in a new thread.

all fine, but...

This RequestHandler function actually does a infinite loop. The loop wil
receive data and take some action and it will send data which is piled up in
this session's queue. The problem that i'm having is that the loop will hang
on socket.recv if the client is not sending anything. Ofcourse this is very
obvious and logical, but i can't think of another way of constructing my
design, so that this problem doesn't occur.

I hope i've made my problem clear to you guys.

thanx,

gumuz





More information about the Python-list mailing list