M
Martin Marcher
Hello,
I created a really simple udp server and protocol but I only get every 2nd
request (and thus answer just every second request).
Maybe someone could shed some light, I'm lost in the dark(tm), sorry if this
is a bit oververbose but to me everything that happens here is black magic,
and I have no clue where the packages go. I can't think of a simpler
protocol than to just receive a fixed max UDP packet size and answer
immediately (read an "echo" server).
thanks
martin
### server.... def __init__(self):
.... SocketServer.UDPServer.__init__(self, ("localhost", 4321),
FooRequestHandler)
........ def handle(self):
.... data, addr_info = self.request[1].recvfrom(65534)
.... print data
.... print addr_info
.... self.request[1].sendto("response", addr_info)
....request 0
('127.0.0.1', 32884)
request 1
('127.0.0.1', 32884)
request 2
('127.0.0.1', 32884)
request 2
('127.0.0.1', 32884)
request 2
('127.0.0.1', 32884)
### client.... s.sendto("request " + str(i), target)
.... s.recv(65534)
....
9
Traceback (most recent call last):
.... s.sendto("request " + str(i), target)
.... s.recv(65534)
....
9
'response'
9
'response'
9
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
--
http://noneisyours.marcher.name
http://feeds.feedburner.com/NoneIsYours
You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.
I created a really simple udp server and protocol but I only get every 2nd
request (and thus answer just every second request).
Maybe someone could shed some light, I'm lost in the dark(tm), sorry if this
is a bit oververbose but to me everything that happens here is black magic,
and I have no clue where the packages go. I can't think of a simpler
protocol than to just receive a fixed max UDP packet size and answer
immediately (read an "echo" server).
thanks
martin
### server.... def __init__(self):
.... SocketServer.UDPServer.__init__(self, ("localhost", 4321),
FooRequestHandler)
........ def handle(self):
.... data, addr_info = self.request[1].recvfrom(65534)
.... print data
.... print addr_info
.... self.request[1].sendto("response", addr_info)
....request 0
('127.0.0.1', 32884)
request 1
('127.0.0.1', 32884)
request 2
('127.0.0.1', 32884)
request 2
('127.0.0.1', 32884)
request 2
('127.0.0.1', 32884)
### client.... s.sendto("request " + str(i), target)
.... s.recv(65534)
....
9
Traceback (most recent call last):
.... s.sendto("request " + str(i), target)
.... s.recv(65534)
....
9
'response'
9
'response'
9
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
--
http://noneisyours.marcher.name
http://feeds.feedburner.com/NoneIsYours
You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.