This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Which socket TCP or BSD

Hello,

I am a bit confused as to which API I should use for communication with PC running Win7.
Seems like the TCP api is more event driven whereas the BSD is the classic implementation. Does the TCP is implemented on top of the BSD sockets or they are not related at all. Do they both require RTX running
The Microcontroller will run as a TCP server.

Many thanks
Nick

Parents
  • I wonder if you're asking about the specific TCPnet implementation supplied by Keil.

    Historically, the TCPnet libraries only supported what I think you are referring to as the TCP API. It can be used both with or without the RTX.

    It provides quite a lot of control, but my personal opinion is that it's not very 'programmer friendly'. For example, the TCP related functions are not re-entrant and the documentation states "All TCPnet-related functionality should be collected in a single networking task". Of course, limitations like these can be overcome, but it certainly took me a considerable time to feel I was controlling it reliably.

    The BSD socket interface was added to TCPnet relatively recently. It attempts to implement a standard Berkeley Socket communication interface. But the documentation states that "These APIs are not a complete implementation of the BSD API". It sits on top of (and makes use of) the original networking facilities.

    I have not used this BSD support, but as far as I am aware they are re-entrant, require the RTX and, being more standard, are more likely to be easier for someone to learn how to use them.

    For any new project, it would probably be sensible to seriously consider using the BSD API.

Reply
  • I wonder if you're asking about the specific TCPnet implementation supplied by Keil.

    Historically, the TCPnet libraries only supported what I think you are referring to as the TCP API. It can be used both with or without the RTX.

    It provides quite a lot of control, but my personal opinion is that it's not very 'programmer friendly'. For example, the TCP related functions are not re-entrant and the documentation states "All TCPnet-related functionality should be collected in a single networking task". Of course, limitations like these can be overcome, but it certainly took me a considerable time to feel I was controlling it reliably.

    The BSD socket interface was added to TCPnet relatively recently. It attempts to implement a standard Berkeley Socket communication interface. But the documentation states that "These APIs are not a complete implementation of the BSD API". It sits on top of (and makes use of) the original networking facilities.

    I have not used this BSD support, but as far as I am aware they are re-entrant, require the RTX and, being more standard, are more likely to be easier for someone to learn how to use them.

    For any new project, it would probably be sensible to seriously consider using the BSD API.

Children