socket connect timeout adjustable?

From: Wigg, David <David.Wigg_at_wang.com>
Date: Tue, 26 Jan 1999 15:40:42 +0100

Hi managers,
                I have a C program that uses socket communication over TCP
to communicate with various hosts. Currently, when I issue a connect to a
host that is uncontactable, the connect call takes 75 seconds to return
before it decides the host is unreachable. What I want it to do is to fail
after say 3 or 4 seconds. I have tried setting send and recv timeouts using
setsockopt, but I still have the same problem. The man pages for setsockopt
suggests there is a way to make the socket non blocking, but I can't find
any info on how to do this. Could someone point in the direction of some
suitable info?

Thanks

Best Regards,

Dave

David Wigg
Senior Consultant
Solutions Integration, Wang Global,
Phone: +44(0)161 848 4146
Email : david.wigg_at_wang.com

mailto:david.wigg_at_wang.com
Received on Tue Jan 26 1999 - 14:45:32 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT