[Tutor] Problem with ThreadingTCPServer Part II
Willi Richert
w.richert@gmx.net
Sat, 21 Jul 2001 11:45:43 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_0093_01C111DA.AC9875A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
here is the second problem I have with ThreadingTCPServer.
What I have forgotten to say: If I start the program the first time it =
reads everything correct. But if it comes to writing in the =
handle-Function I get:
Exception in thread Thread-1:
Traceback (most recent call last):
File "d:\python21\lib\threading.py", line 378, in __bootstrap
self.run()
File "d:\python21\lib\threading.py", line 366, in run
apply(self.__target, self.__args, self.__kwargs)
File "d:\python21\lib\SocketServer.py", line 247, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "d:\python21\lib\SocketServer.py", line 497, in __init__
self.handle()
File "D:\Hearts\Hearts\gameserver.py", line 316, in handle
self.wfile.write(result)
File "d:\python21\lib\socket.py", line 195, in write
self.flush()
File "d:\python21\lib\socket.py", line 182, in flush
self._sock.send(self._wbuf)
AttributeError: 'int' object has no attribute 'send'
After this also reading does not work and throws the Exception I have =
told in the previous message.
Then, if I wait for 5 minutes or so reading again works....
No idea what is wrong!
Do you have one?
willi
------=_NextPart_000_0093_01C111DA.AC9875A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>here is the second problem I have with=20
ThreadingTCPServer.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I have forgotten to say: If I =
start the=20
program the first time it reads everything correct. But if it comes to =
writing=20
in the handle-Function I get:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Exception in thread =
Thread-1:<BR>Traceback (most=20
recent call last):<BR> File "d:\python21\lib\threading.py", line =
378, in=20
__bootstrap<BR> self.run()<BR> File=20
"d:\python21\lib\threading.py", line 366, in run<BR> =20
apply(self.__target, self.__args, self.__kwargs)<BR> File=20
"d:\python21\lib\SocketServer.py", line 247, in=20
finish_request<BR> self.RequestHandlerClass(request,=20
client_address, self)<BR> File "d:\python21\lib\SocketServer.py", =
line=20
497, in __init__<BR> self.handle()<BR> File=20
"D:\Hearts\Hearts\gameserver.py", line 316, in =
handle<BR> =20
self.wfile.write(result)<BR> File "d:\python21\lib\socket.py", =
line 195,=20
in write<BR> self.flush()<BR> File=20
"d:\python21\lib\socket.py", line 182, in flush<BR> =20
self._sock.send(self._wbuf)<BR>AttributeError: 'int' object has no =
attribute=20
'send'</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>After this also reading does not work =
and throws=20
the Exception I have told in the previous message.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Then, if I wait for 5 minutes or so =
reading again=20
works....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>No idea what is wrong!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Do you have one?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>willi<BR></DIV></FONT></BODY></HTML>
------=_NextPart_000_0093_01C111DA.AC9875A0--