socket_recvfrom

From: Date: Tue, 27 Aug 2002 15:23:32 +0000
Subject: socket_recvfrom
Groups: php.dev 
Request: Send a blank email to php-dev+get-87532@lists.php.net to get a copy of this message
Hi! I am not sure if I a) misunderstood what the function is good for b) found a documentation problem or c) found a bug. Maybe one of the more senior people on that list can advise me wether I should file a bug report or not. I am writing some code in PHP that makes use of the socket_ functions and UDP communication. It is my understanding that the function socket_recvfrom() is supposed to read from the socket up to as many bytes as I tell it, store them in a buffer and fill in two variables that tell me from what address:port the packet that I just read actually came from. Am I right with that? If so: Everything seems fine for me except that the buffer is always empty though the functions reports to me that it read n bytes. The other thing that scares me is that I can (or should I say: have to) issue an additional socket_read to read the same packet again; this time my buffer being filles. In fact I could leave out the socket_recvfrom() and just call socket_read, but that way I do not get to know the address:port of the sender. But I don't think it is meant to be use that way (calling both functions one after the other) to get one packet, is it? Any thoughts are welcome. Regards, Torsten

« previous php.dev (#87532) next »