$sux = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); if (!$sux) exit('create error'); if (!socket_bind($sux, $local_ip, 2210)) exit('bind error'); $suxref[] =& $sux; $ip = ''; $port = 7130; do { socket_select($suxref, $write = NULL, $except = NULL, 5); // sec. timout $z = @socket_recvfrom($sux, $buf, 9999, 0, $ip, $port); if (strlen($buf) > 0) { echo "\r\nRemote sent: " . $buf; socket_sendto($sux, "I hear you", 9999, 0x4, $ip, $port); } } while(true);