Hi all again,
manage to do until socket_accept() but found something wrong...when I used non blocking for socket_accept() it will show me that the socket resource is not available. If I set it to blocking, it just keep me waiting and waiting... can someone tell me what is wrong...it is that my socket is not able yet.. this is the sample of my code
<?php
error_reporting(E_ALL);
set_time_limit(35);
ob_implicit_flush();
$address="202.73.40.1";
$port="23";
if (($sock = socket_create (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
echo "socket_create() failed: reason: " . socket_strerror ($sock) . "\n";
}
if (($ret = socket_bind ($sock, $address, $port)) <0)
{
echo "socket_bind() failed: reason: " . socket_strerror ($ret) . "\n";
}
if (($ret = socket_listen ($sock, 10)) < 0)
{
echo "socket_listen() failed: reason: " . socket_strerror ($ret) . "\n";
}
if (($msgsock =socket_accept($sock))<0)
{
echo "socket_accept() failed: reason: " . socket_strerror ($msgsock) . "\n";
}
socket_close($msgsock);
print($msgsock);
system("rm 66.218.73.81");
socket_close($sock);
print("OK");
?>