|
Hi Scott,
I understood what you are saying. My problem is the third party(PC) they do
not want to do the bytes swapping, so my end (On AS/400) need to do the
swapping and send.Is there any other way to do the bytes swapping on
AS/400.
Thanks
Lakshmi
Scott Klement
<klemscot@klements. To: RPG programming on the
AS400 / iSeries
com> <rpg400-l@xxxxxxxxxxxx>
Sent by: cc:
rpg400-l-bounces@mi Subject: Re: Bytes Swapping
in iSeries
drange.com
10/02/2004 11:35 AM
Please respond to
RPG programming on
the AS400 / iSeries
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
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Confidentiality Caution
=======================
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such case, you should destroy this message and kindly
notify the sender by reply email. Opinions, conclusions and other
information in this message that is not of an official nature shall be
deemed as neither given nor endorsed by SGX unless indicated by an
authorised representative independent of this message.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.