[mythtv] MythSocket class

Jim Westfall jwestfall at surrealistic.net
Wed Apr 5 14:55:11 UTC 2006


Isaac Richards <ijr at case.edu> wrote [04.05.06]:
> On Tuesday 04 April 2006 21:08, Jim Westfall wrote:
> > Hi
> >
> > I took a stab at making a MythSocket class that was talked about briefly
> > last week.  Attached is what I have thus far.
> >
> > mythsocket.diff - main patch that adds MythSocket into libmyth without
> > converting anything else.  Its based on QSocketDevice and adds readyRead,
> > connectionClosed, connected, and connectionFailed callbacks.  It also has
> > a connectToHost() function like QSocket to background the connect()
> > process.  I still need to add dns lookup support.
> 
> I think I'd prefer an object that wasn't a QObject and didn't use a 
> QSocketNotifier.  That's what's causing problems with using QSocket now.
> 

hrm I thought it was strictly a QSocket not being thread safe issue.  Multiple 
calls to any of its functions that adjust its internal buffer can result in a 
crash.

How would you go about doing it then?  Have MythSocket create a thread 
and monitor (select()) its own socket?

jim


More information about the mythtv-dev mailing list