Socket recv() problem

Carsten Gaebler cg at schlund.de
Fri Oct 20 07:52:58 EDT 2000


Hi!

It seems to me that a socket's recv() function doesn't read any data in
subsequent calls when called repeatedly. I have the following sending
and receiving programs:

# receiver
import socket, sys
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
sock.bind("/tmp/to_hell.sock")
while 1:
    sys.stdout.write(sock.recv(10))

# sender
import socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
sock.connect("/tmp/to_hell.sock")
s = "0" * 100
sock.send(s)


The receiver prints out only the first 10 "0"s, the rest seems to be
ignored. What's happening here?

Regards
Carsten.



More information about the Python-list mailing list