× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I already explained this to you off-list, but I'll explain it again here:

   htons converts from host byte-order to network byte-order.
   ntohs converts from network to host.

The byte order used by the iSeries is the SAME as the byte order used by
the network -- therefore htons and ntohs are NO-OPs.  They do nothing.

It's the PC that uses a different byte order from the network.  It's the
PC program that needs to call htons, not your RPG program.


On Tue, 10 Feb 2004 srilaxmi@xxxxxxx wrote:
>
> I have a ILERPG Socket program, that sends data in the form of data
> structures to the third party API (written in delphi). The data is
> transmitting fine, but reaching in different format.
>
> Example :
>
> Input:
> Field A = 0         200
>           1st Byte       2nd Byte
>
> Where the Field A is declared as Unsigned 5 U 0 in RPG Pgm.
> When it transmit over a socket, the bytes are swapping and becoming 200  0.
>
> Result:
> Field A = 200       0
>           1st Byte       2nd Byte
>
> This is the problem I am getting. To do the bytes swapping, Can I use htons
> () in RPG Pgm. If yes, please explain with examples.
>
> Thanks & Regards
> Lakshmi

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.