-
Notifications
You must be signed in to change notification settings - Fork 267
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
us_socket_transfer #175
base: master
Are you sure you want to change the base?
us_socket_transfer #175
Conversation
…andling accepted sockets, and calling it from its former location. The new function can now be used to hand off a newly connected socket from outside the framework into the framework.
…andling accepted sockets, and calling it from its former location. The new function can now be used to hand off a newly connected socket from outside the framework into the framework.
…ownsword/uSockets into add-transfer-descriptor-func # Conflicts: # src/libusockets.h
I might use this too |
The idea is more to use a common event loop across all libraries you use, than to manually deal with FD. For instance if you do Asio there is a compilation flag for using Asio under uSockets |
Yes, but sometimes you are just going to have a file descriptor you want that common event loop to use. The OS and most other code deals in file descriptors, so there ought to be a way to introduce an externally created descriptor to enable interop with uWS. In my case I needed to send an accepted socket from another process, but there may be other such use cases. |
This is going to get merged from Bun (where you also have attach/release) in a while. |
3bc1f9d
to
d29d5ba
Compare
Add new function us_socket_transfer by extracting existing code for handling accepted sockets, and calling it from its former location. The new function can now be used to hand off a newly connected socket from outside the framework into the framework.