Ovo je script koji pokusavam da pokrenem (uproscen dosta ali sa istim problemom) na sad vec 3 razlicita servera i dobijam warning iz naslova:
Code:
#!/usr/bin/php -q
<?php
$address = "xxx.xxx.xxx.xxx";
$port = "1050";
/* create a socket in the AF_INET family, using SOCK_STREAM for TCP connection */
$mysock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($mysock, SOL_SOCKET,SO_REUSEADDR, 1);
socket_bind($mysock, $address, $port);
socket_listen($mysock, 5);
$client = socket_accept($mysock);
// Read the input from the client – 1024 bytes
$input = socket_read($client, 1024);
$output = "thanks for connecting, you wrote: ".$input."\r\n";
// Display output back to client
socket_write($client, $output);
socket_close($client);
socket_close($mysock);
?>
#!/usr/bin/php -q
<?php
$address = "xxx.xxx.xxx.xxx";
$port = "1050";
/* create a socket in the AF_INET family, using SOCK_STREAM for TCP connection */
$mysock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($mysock, SOL_SOCKET,SO_REUSEADDR, 1);
socket_bind($mysock, $address, $port);
socket_listen($mysock, 5);
$client = socket_accept($mysock);
// Read the input from the client – 1024 bytes
$input = socket_read($client, 1024);
$output = "thanks for connecting, you wrote: ".$input."\r\n";
// Display output back to client
socket_write($client, $output);
socket_close($client);
socket_close($mysock);
?>
netstat-om sam proverio da li pomenuti port nije vec zauzet - nije.
Code:
socket_set_option($master, SOL_SOCKET,SO_REUSEADDR, 1);
socket_set_option($master, SOL_SOCKET,SO_REUSEADDR, 1);
Ova opcija bi trebala da "odkloni" ovaj warning medjutim i dalje je prisutan.
Script pokrecem drugim scriptom komandom system(); posto nemam pristup preko ssh
Moze li neko da mi kaze gde gresim?
Unapred hvala!
[Ovu poruku je menjao Edward dana 09.12.2007. u 16:18 GMT+1]