[PHP] Re: check socket status

2006-05-10 Thread Barry

Antanas Vipartas schrieb:

Hi

I need to check if socket on some port is listened by some service.

How could I do this ?

thanks,
Antanas Vipartas

Knock at the port door ;)

Nah just kidding. you can try to connect via fsockopen.
I hope that port gives something back you can read out. because every 
port allows connections if it's not blocked or firewalled.


--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: check socket status

2006-05-10 Thread Antanas Vipartas

Barry wrote:
  Knock at the port door ;)


Nah just kidding. you can try to connect via fsockopen.
I hope that port gives something back you can read out. because every 
port allows connections if it's not blocked or firewalled.


actually, it helps. I can sense if the socked is listened. But the 
program, listening on that port, senses the fsockopen connection which 
I don't want to be.


Is there another way to sense if the socked is listened by some service?

thanks
Antanas Vipartas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: check socket status

2006-05-10 Thread Antanas Vipartas

Jim Moseby solved the problem

I didn't even known that I can exec *nix commands straight from php file.

?php
$netstat_info = `netstat -l | grep 5514`; // notice back-tics
echo $netstat;
?

this gave me what I wanted.

Thanks guys for the help

Antanas Vipartas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php