how to check remote server port listening from application.

Hi,

I have an application running on HP-UX, from this application I need to findout if the port number. lets say 7890,7891, 7892 are listening on the remote server running on HP-UX.

Is there any way of doing it using "system()" function or any other?

I noticed that nmap, netcat are not available on HP-UX.

Please let me know.

i tried to use

system("telnet <hostname> <portnum>")

but on success, system function doesn't return back. on failure I get the return value as 1.

Thanks
Einstein