Is socket.recvfrom broken in ActiveState Python 3.2?

bbeacham at desanasystems.com bbeacham at desanasystems.com
Wed Aug 29 20:38:28 EDT 2012


Obviously, this my issue, but I cannot figure out what I am doing wrong.

I have the Python echo server example implemented with the server on a Windows 7 computer and the client on a Linux Redhat server.

The line 'data = sock.recv(1024)' works as expected on the Linux client. 

However, the line 'data, senderAddr = sock.recvfrom(1024)' does not set the 'senderAddr' to anything.

In the code is this line:
print('RECEIVED:', data, "SENDER:", str(senderAddr))

and this is the output.
RECEIVED: Hello, world SENDER: None

On the Windows 7 server side the line 'data = conn.recv(1024)' works fine.

However, the line 'data, remoteAddr = conn.recvfrom(1024)' gives this output;
DATA: Hello, world FROM: (0, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')

While I expect this to be my issue, I cannot find an example via Google as to what I am doing wrong. All examples are pretty much as above.

Any ideas. Is this a bug in 'recvfrom'?




More information about the Python-list mailing list