[Twisted-Python] newbie udp
p@
digi at treepy.com
Sun May 11 23:52:31 MDT 2003
Hi list,
I tested the example given in the documentation. with the following
code:
class UdpServer (DatagramProtocol):
def datagramReceived(self, request, address):
print 'udp recieved:'+request
response = '\x02'
self.transport.write(response,address)
reactor.listenUDP(serverPort, UdpServer())
reactor.run()
if I send a udp packet to this server I get the following exception:
udp recieved:a
Traceback (most recent call last):
File "C:\Python22\Lib\site-packages\twisted\internet\default.py", line
473, in
doSelect
_logrun(selectable, _drdw, selectable, method, dict)
File "C:\Python22\Lib\site-packages\twisted\python\log.py", line 64,
in callWi
thLogger
callWithContext({"system": lp}, func, *args, **kw)
File "C:\Python22\Lib\site-packages\twisted\python\log.py", line 51,
in callWi
thContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "C:\Python22\Lib\site-packages\twisted\python\context.py", line
32, in ca
llWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "C:\Python22\Lib\site-packages\twisted\internet\default.py", line
482, in
_doReadOrWrite
why = getattr(selectable, method)()
File "C:\Python22\Lib\site-packages\twisted\internet\udp.py", line
105, in doR
ead
data, addr = self.socket.recvfrom(self.maxPacketSize)
File "<string>", line 1, in recvfrom
socket.error: (10035, 'The socket operation could not complete without
blocking')
I am on win32 and using python 2.2 and this is twisted 1.0.5. What am I
doing wrong?
Cheers
digi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20030512/cb53b012/attachment.html>
More information about the Twisted-Python
mailing list