On Aug 6, 1:27 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > I don't think that sending the datagram to port 7777 on localhost sends > the message back to the client. I'm guessing the server is sending the > message back to itself, which throws it into the infinite feedback loop > you're experiencing. >
Thanks. On Aug 6, 2:14 pm, anethema <[EMAIL PROTECTED]> wrote: > Yes, you want to use the socket.recvfrom() method, store the address, > and send the response to that address. Your code is indeed repeatedly > sending itself the received message. > > You want to change > >> data = s.recv(1024) > > to > > data, recv_addr = s.recvfrom(1024) > > and > >> size_sent = s.sendto(message[total_sent:], ("localhost", >> 7777) ) > > to > > size_sent = s.sendto(message[total_sent:], recv_addr) > Thanks for the details. > However, your client closes immediately after sending all its data, so > it will never receive that message. > Yes, I commented out the recv() part of the client to debug the infinite loop I was experiencing. When I add that back to the client everything works as it should. Thanks to both of you again. -- http://mail.python.org/mailman/listinfo/python-list