It is not running on a PC. Scott's program is running on an iSeries. It's 
connecting (or in this case, not actually connecting, just not sending back an 
error) to a socket server on a PC.

Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote: > First, byte-ordering. The 
bytes for network values must be in network
> byte order. This happens to be big-endian but PCs and other toys use
> little-endian thus your port number is probably being misinterpreted.

That'd make sense if he's running the code on a little-endian system like 
a PC.  Is that the case?  If so, I completely missed that point...

> A similar misinterpretation will occur with the IP address so you may be 
> attempting to connect to a completely different server which does happen 
> to have a listener on port 23585.

That's only true if he's hard-coding the binary form of the IP address.
The inet_addr() and gethostbyname() functions always return the IP 
addresses in network byte order, so you'll just confuse things by flipping 
it again.


This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.