Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!iuvax!ux1.cso.uiuc.edu!dino!fs-1.iastate.edu!iastate.edu!john From: john@iastate.edu (Hascall John Paul) Newsgroups: comp.protocols.tcp-ip Subject: Problem retrying "connect" Keywords: connect, ULTRIX, tcp Message-ID: <1990Aug29.212123.12889@fs-1.iastate.edu> Date: 29 Aug 90 21:21:23 GMT Sender: usenet@fs-1.iastate.edu (USENET News System) Reply-To: john@iastate.edu (John Hascall) Organization: Project Vincent, Iowa State University Lines: 22 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? Thanks, John Hascall / john@iastate.edu / hascall@atanasoff.cs.iastate.edu