kiss9815 / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Mongoose on Android stop listening after some time #356

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a service that starts a mongoose server
2. Leave it working
3. After some time it stops responding requests

What is the expected output? What do you see instead?
I expected it to work without interruption

What version of the product are you using? On what operating system?
Trunk

Please provide any additional information below.
It seems that on android the network layer change a bit frequently, wifi goes 
on/off phone radio goes on/off and with those changes the listening sockets get 
invalidated, there is system messages that can be used to be notified but it 
seems that the event loop of mongoose doesn't stop when the mainlistening 
sockets get invalidated and it appears to be working when in reality it isn't.

There is some signals that are ignored on mg_start function.

Maybe we need to attach to another signal to catch when the main sockets get 
invalidated to restart then.

Can someone give any clue with this issue ?

Original issue reported on code.google.com by mingo...@gmail.com on 28 May 2012 at 7:26

GoogleCodeExporter commented 9 years ago
Continuing with this, how can we check that mongoose listening sockets are 
active ?
Only making a call from outside ?

Original comment by mingo...@gmail.com on 28 May 2012 at 7:44

GoogleCodeExporter commented 9 years ago
Could you put some debug messages in master_thread() , in select loop to verify 
whether select is returning with error when network disappears?

Original comment by valenok on 31 May 2012 at 9:17

GoogleCodeExporter commented 9 years ago
The thing is that the main thread never check for error to stop the loop, what 
are you sugesting to test for error and break the loop ?

Original comment by mingo...@gmail.com on 7 Jun 2012 at 12:41