Opened 20 years ago
Closed 20 years ago
#155 closed patch (fixed)
Patch to allow connections to the backend that don't block shutdown
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
This patch allows for connections to the backend that don't stop the main server from shutting down the system if it is idle.
Useful if you want to create a status app that connects to the backend to query the server for current recording status, scheduled program info and receive schedule/recordings change events etc. but don't want to prevent the backend from shutting things down if it is idle.
The patch adds two new commands you can send to the server "ALLOW_SHUTDOWN" and "BLOCK_SHUTDOWN" they simply set a flag in the playbacksock. When the main server checks for active connections in MainServer::isClientConnected() it ignores any connections that don't have the blockshutdown flag set. The default behavior is to block shutdown so everything will work has it does now unless the server receives a command to change that.
There are two new helper functions MythContext::AllowShutdown?() and MythContext::BlockShutdown?() which sets how the two sockets created by the MythContext object block or allow the backend to shutdown.
I have a further patch that adds a welcome/status app to myth that is designed to be run all the time but will usually only be visible if the frontend is not running. ie the system has been started to record a scheduled recording for example. It displays some status information about what Myth is upto at the moment; recording, grabbing EPG data, com. flagging, transcoding etc. Also shows what is currently recording, and what the next scheduled recording is. It also has a button which allows you to start the frontend if you want.
I'll send it to the tracker later if this patch gets the thumbs up.
Paul
Attachments (2)
Change History (7)
Changed 20 years ago by
Attachment: | mythtv.diff added |
---|
comment:2 Changed 20 years ago by
What's the uncommented ReadStringList? for?
It's been a while since I wrote that patch but I seem to remember while testing the patch I added some debug code to check I was getting the correct response from the backend. The server socked replys where in sync but I noticed that the responses from the event socked where always lagging one reply behind where they should be. Or I wasn't getting the expected reply.
I think I traced the problem to the commented ReadStringList? in EventSockedConnected?(). We never read the reply to "ANN Playback". So the first time we do a ReadStringList? from the event socked we get the 'OK' reply from the "ANN Playback".
I've been using the patch now for about 2 months without any problems.
Paul
comment:3 Changed 20 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 20 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Thanks for applying the patch.
I have just noticed I missed an important change from the original patch.
Its a small change but an important one because without it the blockshutdown flag is uninitialised and could result in the backend shutting things down randomly.
Its the result of having to edit the diff to remove other stuff that didn't belong in the original patch. I must have deleted it by mistake.
Added a new patch to fix it. Paul
Changed 20 years ago by
Attachment: | playbacksock.diff added |
---|
patch to fix uninitialised blockshutdown flag
Patch file