On 17/08/2005 6:31 p.m., Aaron Schiff wrote:
Here's what I got:

    <?
    $ip = "SERVERIP";
    $port = 27015;
    if (!($socket = socket_create(AF_INET,SOCK_DGRAM,SOL_UDP))||
    !socket_set_option($socket, SOL_SOCKET, SO_BROADCAST, 1)||
    !socket_set_nonblock($socket)||
    !socket_bind($socket,$ip,$port)||
    !socket_connect($socket,$ip,$port))
<snip>

    *Warning*: socket_bind() unable to bind address [99]: Cannot assign
    requested address in */home/cs78552/public_html/tester.php* on line *7*
    Cannot assign requested address
    *Warning* : socket_recvfrom() unable to recvfrom [11]: Resource
    temporarily unavailable in */home/cs78552/public_html/tester.php* on
    line *16*


You are trying to bind the local socket to the remote IP address. When you bind a socket you are setting a local interface for the connection to go out on, so this won't work. Hence the error "Cannot assign requested address".

You should probably just remove the "!socket_bind($socket,$ip,$port)||" line.

-Simon

_______________________________________________
hlds_apps mailing list
hlds_apps@list.valvesoftware.com
http://list.valvesoftware.com/mailman/listinfo/hlds_apps

Reply via email to