recv() vs. NetSock_RxData()

recv() vs. NetSock_RxData()

Home Forums Networking Software recv() vs. NetSock_RxData()

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  Matt Gordon 2 years, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #15254

    Yau Jeiwing

    I am starting a new project with uC-TCPIP, and I found two functions for receiving: recv() and NetSock_RxData(). I wrote sockets code in my last job, and I am familiar with recv(), but I don’t know much about NetSock_RxData(). What are the differences between these two functions?


    Matt Gordon

    µC/TCP-IP actually offers two different APIs. With one of the two interfaces, the stack implements the familiar BSD socket functions. These functions, including recv(), are used in a wide variety of existing network applications and are well known to many developers with experience writing socket code. The primary motivation for implementing these functions within µC/TCP-IP, then, was portability—it should be fairly easy to adapt an application written for another BSD-compatible TCP/IP stack to µC/TCP-IP, or to go in the opposite direction, using a µC/TCP-IP-based application with a different stack.

    The other API available with µC/TCP-IP is unique to Micrium. This proprietary API follows the same naming conventions seen in µC/OS-III and other Micrium modules, so developers who are familiar with those modules should find it relatively easy to use. Additionally, the Micrium API offers error reporting that is somewhat richer than that available with BSD sockets, making it an appealing option for developers who require feedback from their sockets for debugging.

    Ultimately, the tradeoff to be considered by application developers attempting to choose between the two APIs is that of portability versus intuitive naming and error reporting. These concerns aside, the two interfaces are very similar—recv() and NetSock_RxData() both provide an effective mechanism for receiving socket data. For more information on these and other µC/TCP-IP API functions, you can check the TCP portion of Micrium’s documentation site.

    • This reply was modified 1 year, 7 months ago by  Micrium.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

View the complete site map