[mythtv] MythSocket class
ijr at case.edu
Wed Jun 7 03:15:35 UTC 2006
On Tuesday 30 May 2006 12:27 am, Jim Westfall wrote:
> Isaac Richards <ijr at case.edu> wrote [05.29.06]:
> > On Monday 29 May 2006 1:03 pm, Jim Westfall wrote:
> > Hrm. Don't really like making that explicit like that - have to modify
> > MythContext as well. I think a check for if the socket is locked or not
> > in the select thread should accomplish mostly the same thing.
> > Or, we could do all reading of available data into a buffer in that
> > select thread.
> It should only been needed if the readyRead() callback doesnt fully read
> what it needs to read from the socket. The backend doesnt do any reading
> from the socket in readyRead(), its just hands it to a worker thread and
> returns. The socket cant be put back onto the select list until
> ProcessRequest() returns, since multiple read/writeStringLists can occur
> as part of the processing.
> I am not sure the normal sock->Lock() will work because
> PlaybackSock::SendReceiveStringList() also does a sock->Lock().
> The other issue he is still having is the EncoderLink class since it
> interacts with the socket on its own to get free space and max bitrate on
> the slave backend. It looks like once the slave backend registers with
> the master, the master takes control of the socket? If that is the case
> we should be able to disable the socket from being on the select list
> once ANN SlaveBackend is seen.
Ignoring reads when the socket is locked fixes the EncoderLink and other
classes using the socket case - they all lock the socket before writing to it
and waiting for a reply.
Found what was causing the slave disconnects, though. =) Bug in
connectionClosed function in MainServer.
John, try this patch (newly generated against TOT). I set up a slave backend
and banged on things a bit (started/stopped recordings/live-tv, remote
frontend stuff & local playback as well), and things seem stable here. No
speed differences that I can tell, either.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 15297 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20060606/1e21c230/attachment.bin
More information about the mythtv-dev