Problems using SocketServer.ThreadingTCPServer

Joao Prado Maia JMaia at lexgen.com
Thu Jan 31 16:46:48 EST 2002


> > > I'm not completely sure, but I think it's your job to detect
> > > end-of-connection in your handle() method and return. The
> > > TCPServer, I believe, just does:
> > >
> > >     rqh = YourRequestHandlerClass(...)
> > >     rqh.setup()
> > >     rqh.handle()
> > >     rqh.finish()
> > >
> > 
> > Well yes, but I'm already doing that on the line that does 
> a 'continue' on
> > the loop, which breaks the loop (yes, I realize I should 
> just 'break' it ;)
> > and returns from the handle() function.
> 
> Since you've already strip()'d the line when you get to
> that test, you may be breaking the connection when OE has
> *not* closed it. Maybe the problem is OE having to continually
> reconnect? Which is possibly what you said in your original
> message, and I missed it. Also, I have to apologize for
> not giving your code a closer reading before trying to
> answer your question. But I think to be completely safe,
> you must check for line=='' *before* calling strip(),
> or test for self.inputline=='', instead of line==''.
> 

That doesn't fix the problem. Outlook Express doesn't send spaces when the
problem starts happening, it really does send 'empty' lines. Not even a
'\r\n' is sent, just a nulled string (or whatever you want to call it ;).

In any case, what is the purpose for an infinite stream of empty lines that
OE keeps sending thru the socket at what appears like random intervals of
time ? It really seems like I'm doing something wrong on my little server
that doesn't account for this situation. Like I said on my original email,
there are several similar projects of Usenet servers that never experienced
what I'm experiencing now with Outlook Express. This is why I suspect the
problem is related to something in my code.

If you want to take a look on the real code again, please do so below:

http://cvs.phpbrasil.com/chora/co.php/papercut/papercut.py?r=1.23

Cheers,
Joao


*************************************************************************** 
 The contents of this communication are intended only for the addressee and
may contain confidential and/or privileged material. If you are not the
intended recipient, please do not read, copy, use or disclose this
communication and notify the sender.  Opinions, conclusions and other
information in this communication that do not relate to the official
business of my company shall be understood as neither given nor endorsed by
it.  
*************************************************************************** 






More information about the Python-list mailing list