From: jtk@atria.com (John T. Kohl)
Subject: Re: sin_port weirdness in DEC OSF/1?
Date: Fri, 11 Mar 1994 14:23:03 GMT [thread overview]
Message-ID: <CMI7yG.623@atria.com> (raw)
In-Reply-To: robm@ncsa.uiuc.edu's message of 10 Mar 1994 23:20:43 GMT
>>>>> "Rob" == Rob McCool <robm@ncsa.uiuc.edu> writes:
In article <2loa0b$sqk@vixen.cso.uiuc.edu> robm@ncsa.uiuc.edu (Rob McCool) writes:
Rob> Hi, in the source for my information server, I need to find out what port a
Rob> given socket is attached to while running under inetd. I'm finding that
Rob> while my code to do this works elsewhere, it fails miserably under OSF/1,
Rob> returning a very large integer (usually 20480 or 36895). Here is the code:
DEC OSF/1 on Alpha AXP uses a different byte order from network byte
order; getsockname() reports the address and port number in network byte
order.
You should use ntohs() (network to host short) to convert the value. On
machines which have matching network and host byte order, the function
is a null macro; on machines like the DEC Alpha AXP, it's a
byte-swapping function.
--
John Kohl <jtk@atria.com> or <jtkohl@mit.edu>
working for but not representing: Atria Software
---------
Oh, just enjoy yourself!
prev parent reply other threads:[~1994-03-11 14:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-03-10 23:20 sin_port weirdness in DEC OSF/1? Rob McCool
1994-03-11 4:16 ` Rob McCool
1994-03-11 7:42 ` Peter Brouwer
1994-03-11 14:23 ` John T. Kohl [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox