Problems with sockets on Win NT

Donn Cave donn at u.washington.edu
Thu Aug 5 17:52:08 CEST 1999


mkrishnam at my-deja.com writes:
| I'm trying to exchange datagram (UDP) packets
| between a unix machine and a Win NT machine.
|
| The UDP packets sent from Win NT machine are
| received properly on unix machine. However UDP
| packets sent from unix machine is not at all
| received on WinNT machine.
|
| I'm using recvfrom method to receive the packets.
|
| The code I'm using is as below.

In this code, you seem to be using recv() instead of recvfrom().
Maybe you could follow up with some clarification.

	Donn Cave, University Computing Services, University of Washington
	donn at u.washington.edu
-----------------------------
| # Code on Win NT machine
|
| from socket import *
|
| my_sock = socket(AF_INET, SOCK_DGRAM)
| my_sock.bind('localhost', 6123)
|
| while(1):
|         test = my_sock.recv(1024)
|         print "got it!"
|
| # Code on Unix machine
|
| from socket import *
|
| my_sock = socket(AF_INET, SOCK_DGRAM)
| my_sock.bind('localhost', 6440)
|
| dst_addr = 'leto',6123
|
| while (1):
|         print my_sock.sendto("Hello", dst_addr)




More information about the Python-list mailing list