gerry
04-04-2003, 07:58 PM
Hi there,
I'm just starting with socket programming and I wanna make a program, that
looks for an open port on a given ip-address. That should be easy - I hoped ...
I wanna get a return message, if server and port is not accepting client calls.
First I tried it with "connect ()" . That works fine when the server has an open port and sends me an syn/ack - BUT : if the server does not send an syn/ack the connect () waits forever - sending a syn periodically. Is there a chance t set the timeout for connect () [e.g. setsockopt ()] ????
Second I tried raw IP. I send a syn-packet and waited for a syn/ack. Using sendto and recv. But I can only see my syn with tcpdump.
Maybe that everything is so easy - and I'm so fool - sorry I cannot get the stuff running.
Can somebody please give me sample-code or any hint ...
TIA
Gerry
:oops:
I'm just starting with socket programming and I wanna make a program, that
looks for an open port on a given ip-address. That should be easy - I hoped ...
I wanna get a return message, if server and port is not accepting client calls.
First I tried it with "connect ()" . That works fine when the server has an open port and sends me an syn/ack - BUT : if the server does not send an syn/ack the connect () waits forever - sending a syn periodically. Is there a chance t set the timeout for connect () [e.g. setsockopt ()] ????
Second I tried raw IP. I send a syn-packet and waited for a syn/ack. Using sendto and recv. But I can only see my syn with tcpdump.
Maybe that everything is so easy - and I'm so fool - sorry I cannot get the stuff running.
Can somebody please give me sample-code or any hint ...
TIA
Gerry
:oops: