Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!brl-adm!brl-smoke!smoke!bzs@BU-CS.BU.EDU From: bzs@BU-CS.BU.EDU Newsgroups: net.unix-wizards Subject: Re: a problem with sockets Message-ID: <2416@brl-smoke.ARPA> Date: Sat, 19-Jul-86 23:05:38 EDT Article-I.D.: brl-smok.2416 Posted: Sat Jul 19 23:05:38 1986 Date-Received: Sun, 20-Jul-86 07:56:36 EDT Sender: news@brl-smoke.ARPA Lines: 24 >From: Moises Lejter >...When the client is on a different >machine from the server, the client call to "connect()" fails >with a "connection refused" error... >...I should mention that the problem >seems to occur only when one of the machines is a SUN and the >other a VAX; when both processes are on VAXes only, or on SUNs >only, they work just fine. In the server and client's main()s change: inet_host.sin_port = INET_PORT; to inet_host.sin_port = htons(INET_PORT); Remember that a VAX is byte-swapped relative to the network, the above macro fixes it on the VAX (and leaves it alone on the SUN, it's a no-op.) You got "connection refused" because you were trying to rendezvous on the wrong socket number (you get that message if there is noone listening on the requested remote socket.) See 'man byteorder' for further details. -Barry Shein, Boston University