-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
New package: libwebsockets #213
base: master
Are you sure you want to change the base?
Conversation
-DLWS_PLAT_NX=ON \ | ||
-DLWS_WITH_UDP=OFF \ | ||
-DLWS_WITH_FILE_OPS=OFF \ | ||
-DCMAKE_BUILD_TYPE=DEBUG \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want -DCMAKE_BUILD_TYPE=RELEASE here I think.
+#include <arpa/inet.h> | ||
+#include <fcntl.h> | ||
+#include <switch/kernel/mutex.h> | ||
+#include <switch/services/bsd.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use this bsd header. We translate between newlib fds & horizon fds internally. Use standard <sys/socket.h>
+#define compatible_close(x) close(x) | ||
+#define lws_plat_socket_offset() 0 | ||
+#define wsi_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] | ||
+#define shutdown(sockfd, how) bsdShutdown(sockfd, how) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shutdown is found in <sys/socket.h> don't use the bsd functions directly.
Thanks for the review @WinterMute! |
This adds support for libwebsockets
the port is pretty simple, mostly the same as the
freertos
platform used by esp32