Skip to content

Instantly share code, notes, and snippets.

@friedkeenan
Created November 14, 2019 15:28
Show Gist options
  • Save friedkeenan/158daa5578fbe20796da450cf8084c5f to your computer and use it in GitHub Desktop.
Save friedkeenan/158daa5578fbe20796da450cf8084c5f to your computer and use it in GitHub Desktop.
Minimal example to show the socketInitializeDefault hang
#include <stdio.h>
#include <switch.h>
int main(int argc, char **argv) {
consoleInit(NULL);
printf("Before socketInitializeDefault\n");
consoleUpdate(NULL);
socketInitializeDefault();
printf("After socketInitializeDefault\n");
consoleUpdate(NULL);
printf("Press + to reload current NRO\n");
printf("Press - to return to the homebrew menu\n");
consoleUpdate(NULL);
while (appletMainLoop()) {
hidScanInput();
u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
if (kDown & KEY_PLUS) {
envSetNextLoad(argv[0], argv[0]);
break;
}
if (kDown & KEY_MINUS)
break;
}
socketExit();
consoleExit(NULL);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment