Do I need to use htons/htonl when setting up TCP and UDP comms using p1025 QorIQ?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Do I need to use htons/htonl when setting up TCP and UDP comms using p1025 QorIQ?

ソリューションへジャンプ
1,974件の閲覧回数
clivestokes
Contributor I

I am new to TCP and UDP  comms and am working with code that has worked on the TWR QorIQ MPU Tower System Module but under QNX.

The code sets up the client and remote socket info using htons on the ports and htonl on the remote address which I assumed would be unchanged (same processor) when the code was ported to work under MQX. However I  note from the discussion headed htons problem with K60?  MQX bug? that MQX may be non-standard in this area. Can someone provide clarification?



ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
1,438件の閲覧回数
butok
NXP Employee
NXP Employee

Hi Clive,

This is legacy feature of RTCS. Port and IPv4 address are in host-endian format.

Yes. It is very confusion, especially for somebody who came from other stack.

I would change it, even if it will require rewriting of existing application, just to follow some BSD-Socket approach.

Before we do it (as it will break all existing RTCS application), I need to see that there is real support of this change from MQX/RTCS community

Thank you,

Andrey Butok

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,439件の閲覧回数
butok
NXP Employee
NXP Employee

Hi Clive,

This is legacy feature of RTCS. Port and IPv4 address are in host-endian format.

Yes. It is very confusion, especially for somebody who came from other stack.

I would change it, even if it will require rewriting of existing application, just to follow some BSD-Socket approach.

Before we do it (as it will break all existing RTCS application), I need to see that there is real support of this change from MQX/RTCS community

Thank you,

Andrey Butok

0 件の賞賛
返信