How does Roku handle screensaver and msg ports ?
I've noticed that if I have active sockets, I get a lot of false msg responses.
This is indicative of the problem of select() when you don't drain the queued messages.
All of my objects are linked to three global msg ports. When the screensaver activates, I start getting errors.
The
"* LOG SKT" entries are generated by an input socket event with NO data.
roSocketEvent UDP Broadcast 995757880 readable True MAX 14 CUR 1
Received Broadcast message: 192.168.1.4:64276 KNOWN http://192.168.1.4:8895/deviceDescription/204683ed-9f48-3c47-b70d-0da4ab7276fa for Windows 7, UPnP/1.0 DLNADOC/1.50, Serviio/1.4.1.2
Msg Queue 0 / 0 / 0
* LOG SKT UDP Broadcast errors = 212 MAX 14 CUR 1
drained 0 items
Msg Queue 0 / 0 / 0
roSocketEvent UDP Broadcast 995757880 readable True MAX 14 CUR 1
Received Broadcast message: 192.168.1.4:1030 M-SEARCH ST: urn:schemas-upnp-org:device:RemoteUIClientDevice:1
Msg Queue 0 / 0 / 0
roSocketEvent UDP Broadcast 995757880 readable True MAX 14 CUR 1
Received Broadcast message: 192.168.1.4:1030 M-SEARCH ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1
Msg Queue 0 / 0 / 0
* LOG SKT UDP Broadcast errors = 213 MAX 14 CUR 1
drained 0 items
After about two minutes, I stop getting any traces at all from the Telnet debug console ???
Then when I click a button, the Telnet console resumes and the screensaver exits and I get a VERY large number of msg events queued.
The
"Msg Queue" entries show the counts of each of my ports. The last is the one I use for sockets.
102351 msg events is a lot !* Garbage roAssociativeArray
. COUNT: 84736
. ORPHANED: 0
. ROOT: 83
* Set Timer - GA_Idle now 1433936 expires 1443936
* Timed queue return - 822659
Msg Queue 0 / 0 / 102351
roSocketEvent UDP Broadcast 995757880 readable True MAX 81771 CUR 81771
Received Broadcast message: 192.168.1.4:1030 M-SEARCH ST: urn:pv-com:device:WebdavServer:1
Now 1438725 expires 678124
* Timed queue activate - UDP_Search
Udp Search (101) rootdevice OK, MediaServer OK, Notify OK
* Set Timer - UDP_Search now 1438744 expires 1558744
* Timed queue return - 23
Msg Queue 0 / 0 / 3
This causes the remote to be very sluggish or fails to respond and may even crash if the screensaver is active for a long period.
The large counts only show up on 3.x boxes, where the no data msgs apply to all.
What is the mechanism that screen saving employs. Is the intermediate code actually testing my ports and passing it on to the screensaver ?
I thought that the screensaver preempted my activity but I'm still able to get some interrupts even though it is active ???
I put in a kludge that if the queue count was over 25, just through them away ? Not a very good practice but it clears the problem.