Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!ultra!ted From: ted@ultra.com (Ted Schroeder) Newsgroups: comp.protocols.tcp-ip Subject: Re: Problem retrying "connect" Keywords: connect, ULTRIX, tcp Message-ID: <1990Aug30.181010.1428@ultra.com> Date: 30 Aug 90 18:10:10 GMT References: <1990Aug29.212123.12889@fs-1.iastate.edu> Organization: Ultra Network Technologies Lines: 33 In <1990Aug29.212123.12889@fs-1.iastate.edu> john@iastate.edu (Hascall John Paul) writes: >Given the following code: > [... socket(), getservbyname(), sin <- values ...] > while (connect(s, &sin, sizeof(sin)) < 0) { > perror("connect"); > if (++retry > RETRY) exit(1); > sleep(2); > } >If the server (to which I am trying to connect) is not there, I get: > connect: Connection refused <-- expected > connect: Invalid argument <-- WHY?? > : > : > connect: Invalid argument >What am i forgetting here? My manual page (SunOS 4.0.3c) says you get EINVAL when "namelen is not the size of a valid address for the specified address family". I'd guess that the connect mucked up the sin somehow. Ted Schroeder ted@Ultra.com Ultra Network Technologies ...!ames!ultra!ted 101 Daggett Drive San Jose, CA 95134 408-922-0100 Disclaimer: I don't even believe what I say, why should my company?