UDP Client/Server

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top