tags:

views:

16

answers:

0

Code Snippet:

$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("Could not create socket\n");

$recvsock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n");

socket_bind($recvsock, "192.168.3.149", "49217") or die ("Could not bind");

socket_listen($recvsock);

socket_sendto($socket, $packet, strlen($packet), 0, "224.0.0.251", "5353");

$rs = socket_accept($recvsock);

socket_recvfrom($rs,$buf,4096,0,$clientIP,$clientPort);

echo $buf;

I get the error "PHP Warning: socket_recvfrom(): Unsupported socket type 774909488" whenever I run this code. It is referring to the line "socket_recvfrom($rs,$buf,4096,0,$clientIP,$clientPort);"

Just can't figure it out. I looked through my php.ini file. Didn't see anything out of the ordinary. I'm on windows btw.

extension=php_sockets.dll That is right.

Is there another dll that I need to make this work. I also disabled my firewall just in case something was messing up there. That didn't change anything.

I started working on this code about a year ago on a windows vista computer. I wish I had made better notes. I thought I had this script working, but I can't say for sure since it's the last thing I was working on. At any rate, I'm on win 7 now and picking the project back up.

If anyone has ran into a similar problem or knows the answer, it would be greatly appreciated.