Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28082

Is socket.recvfrom broken in ActiveState Python 3.2?

Newsgroups comp.lang.python
Date 2012-08-29 17:38 -0700
Message-ID <cf594a09-d5d2-4d92-912e-b283f4a2fa07@googlegroups.com> (permalink)
Subject Is socket.recvfrom broken in ActiveState Python 3.2?
From bbeacham@desanasystems.com

Show all headers | View raw


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'?

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Is socket.recvfrom broken in ActiveState Python 3.2? bbeacham@desanasystems.com - 2012-08-29 17:38 -0700
  Re: Is socket.recvfrom broken in ActiveState Python 3.2? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-29 22:22 -0400

csiph-web