-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Network socket changes: socket_lib_finish() shouldn't be a stub function #169
Comments
I've created a branch: https://github.com/devkitPro/wut/tree/socket-init This branch makes it possible to call socket_lib_init/finalize again, which now performs refcounting and handles devoptab registration/etc. However, the main addition is the ability to override the socket initialization/deinitialization logic, so that it can be customized to do things such as setting up somemopt. E.g. void __init_wut_socket()
{
socket_lib_init();
// somemopt thread creation goes here
// wait for somemopt to be initialized? dunno how that's done
// AC initialization/connection goes here
}
void __fini_wut_socket()
{
// AC deinitialization goes here
socket_lib_finish();
// somemopt thread teardown goes here
} Please test this branch, and see if the changes suit your use case. |
See eb03061 socket_lib_init/finish are no longer stubs. |
If one calls somemopt the homebrew will never be able to exit as somemopt blocks untill socket_lib_finish is called which can't be done if said function is replaced by a stub.
Now you might ask "why call somemopt in the first place?" - the answer is simple: Performance reasons. You'll get much faster up-/downloads by using I/O buffers in userspace and the way to set these buffers is somemopt (socket memory option).
Example code to show the issue:
The text was updated successfully, but these errors were encountered: