PHP expert |
|
<?
function opensocket()
{
$address = '156.34.234.34'; //$address = '156.34.234.34';
$port = 6000; //$port = 6000;
//connectie met socket ed
if (($sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP )) < 0)
{
echo "socket_create() failed: reason: " . socket_strerror($sock) . "\n";
}
if (($ret = socket_connect($sock, $address, $port)) < 0)
{
echo "socket_bind() failed: reason: " . socket_strerror($ret) . "\n";
}
return $sock;
} //end opensocket
function writesocket($msg,$sock)
{
socket_write($sock, $msg, strlen($msg));
} //end writesocket
writesocket('mijn bericht',opensocket());?>
<? function opensocket() { $address = '156.34.234.34'; //$address = '156.34.234.34'; $port = 6000; //$port = 6000; //connectie met socket ed { } { } return $sock; } //end opensocket function writesocket($msg,$sock) { } //end writesocket writesocket('mijn bericht',opensocket());?>
|