Welcome! Log In Create A New Profile Wiibrew Wiki HackMii Blog

Advanced

net_socket() fails if left idle for 1 minute

Posted by owen 
net_socket() fails if left idle for 1 minute
November 06, 2015 12:45AM
I can connect and load a webpage fine (for my leaderboards) but if I stop making connections for more than a minute and then try again I get a -126 result from s32 socket = net_socket(AF_INET, SOCK_STREAM, IPPROTO_IP);

I am not sure if this only happens to me on my router or if that is how the wii networking operates. How do I keep it alive? I don't really need to be constantly loading the page but I'd like it to always be available for submiting scores.
Re: net_socket() fails if left idle for 1 minute
November 06, 2015 09:12PM
That error is ENETRESET, it means the wifi connection dropped out and the network has to be shutdown then reinitialized.
Re: net_socket() fails if left idle for 1 minute
November 06, 2015 09:37PM
What's causing it? I only get the error if I stop requesting new connections for a minute. And after it happens I can't reconnect. Only way I can reconnect Is by exiting my app.



Edited 1 time(s). Last edit at 11/06/2015 09:38PM by owen.
Re: net_socket() fails if left idle for 1 minute
November 07, 2015 02:03AM
The cause is probably a poor wifi signal, maybe your router is set to disconnect idle devices, maybe there's an IP conflict with another device...
You won't be able to reconnect unless you shutdown the network (net_deinit + net_wc24cleanup) and reinitialize it.
Sorry, only registered users may post in this forum.

Click here to login