Htons?

This is a discussion on Htons? within the Networking/Device Communication forums, part of the General Programming Boards category; Should htons be used on all data recieved by a winsock?...

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    10

    Htons?

    Should htons be used on all data recieved by a winsock?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    no, it should not.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    htons shouldn't be used on any data received over a network it should be used on data sent over a network and then only when the remote peer expects it. ntohs is used on received data.

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    10
    I see, could you possibly help with this problem?

    Type Conversions

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use of htons() and ntohs()
    By Andystudent in forum C Programming
    Replies: 4
    Last Post: 01-19-2006, 09:06 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21