Another socket/thread question

Ken khirmint at hotmail.com
Wed Mar 13 18:08:19 EST 2002


I thought so as well.. but it doesn't seem to. When I call the close ()
function on the socket object, it just sits there untill I send another
keybord interupt. I also tried the socket.shutdown function as well.

Would've been an ideal solution though..

"Ype Kingma" <ykingma at accessforall.nl> wrote in message
news:3C8FA777.8A5B07D1 at accessforall.nl...
>
>
> Ken wrote:
> >
> > Hey everyone..
> >
> > I've got a thread that continously listens to a socket, and reports what
it
> > receives. Blocking is turned on, and I would like it to stay that way
since
> > the only thing the thread has to do, is listen to the socket.
> >
> > My question is when the socket needs to be closed (program shuts down,
or
> > that user is being disconnected by the server) is it possible to
interupt a
> > socket.recv ()?
>
> When you close the socket from another thread or by the server,
> the pending socket.recv() should terminate with some error condition.
> It's best to test both situations, however.
>
> Have fun,
> Ype





More information about the Python-list mailing list