Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] <add BSD sockets interface> #1070

Closed
bigtreeboy opened this issue Jan 4, 2024 · 4 comments
Closed

[Feature Request] <add BSD sockets interface> #1070

bigtreeboy opened this issue Jan 4, 2024 · 4 comments

Comments

@bigtreeboy
Copy link

I have had a BSD sockets based application.
Now I want to change the TCP/IP stack to freeRTOS-Plus-TCP.
but, unfortunately, freeRTOS-Plus-TCP doesn't supply the BSD sockets interface directly.
If freeRTOS-Plus-TCP has the BSD sockets interface, I don't need change anything in the application.

@bigtreeboy bigtreeboy changed the title [Feature Request] <add BSD sockets porting> [Feature Request] <add BSD sockets interface> Jan 4, 2024
@tony-josi-aws
Copy link
Member

Hi @bigtreeboy,

FreeRTOS+TCP supports BSD style sockets and APIs. Refer: Primary Sockets Functions

Suggest you to post these queries in the FreeRTOS Forum.

@bigtreeboy
Copy link
Author

bigtreeboy commented Jan 5, 2024

Hi @tony-josi-aws, thanks for your answer.
But, was there these header file in current freeRTOS-Plus-TCP repo?
according to Berkeley sockets, the standard headers are sockets.h netdb.h and so on.
Because I have had a unix based application, I want to reuse this code without changing anything.

@htibosch
Copy link
Contributor

htibosch commented Jan 5, 2024

PS. please close this subject and continue on the FreeRTOS forum.

What you can do is create a new set of sockets.h, netdb.h etc, and from there you can include the FreeRTOS includes.

Also, you can introduce these kind of macros:

#define socket    FreeRTOS_socket
#define bind      FreeRTOS_bind
#define listen    FreeRTOS_listen
#define connect   FreeRTOS_connect
#define accept    FreeRTOS_accept
#define recvfrom  FreeRTOS_recvfrom
#define sendto    FreeRTOS_sendto
#define recv      FreeRTOS_recv
#define send      FreeRTOS_send

You will have to study the Linux application and check if the FreeRTOS functions do exactly the same.
And at some point, you will need an intermediate function when the use of parameters is slightly different, such as select().

@bigtreeboy
Copy link
Author

If there is a official version for BSD sockets interface, I think it's better.
of cause, I can implement it by myself.
I will close this feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants