Telnet to localhost works but not IP in php socket code -
here php socket reading code
<?php $host = "0.0.0.0"; $port = 5060; set_time_limit(0); $socket = socket_create(af_inet, sock_stream, 0) or die("could not create socket\n"); $result = socket_bind($socket, $host, $port) or die("could not bind socket\n"); $result = socket_listen($socket, 3) or die("could not set socket listener\n"); while(1) { $spawn = socket_accept($socket) or die("could not accept incoming connection\n"); while ($input = socket_read($spawn, 1024)) { $input = trim($input); echo "client message : " . $input; } socket_close($spawn); } socket_close($socket); ?>
i'm able telnet localhost 5060
i'm not able telnet 192.168.12.154 5060
.it exists after 1 input only. can might wrong
Comments
Post a Comment