[mythtv] MythSocket class

Mark Paulus mark.paulus at verizonbusiness.com
Wed Apr 5 16:59:51 UTC 2006


This may be a stupid question, but if we have un-threadsafe socket 
issues, why don't we use standard mutexes (sp??) to protect the socket 
operations??

Isaac Richards wrote:
> On Wednesday 05 April 2006 10:55, Jim Westfall wrote:
>> 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.
> 
> I've seen bunches of crashes due to the QSocketNotifier as well.  However, it 
> may be ok if we add qApp->lock/unlock around those (un)registerSocketNotifier 
> calls..  I think the crashes were probably from QSocket weirdness (it tends 
> to occasionally add multiple notifiers of the same type for the same socket, 
> which seems to go horribly wrong).
> 
>> How would you go about doing it then?  Have MythSocket create a thread
>> and monitor (select()) its own socket?
> 
> Something like that, yeah.  Let's try what you have, first, just with some 
> additional locking, and adding refcounting to the class, too..
> 
> Isaac
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 

-- 
Mark Paulus
2424 Garden of the Gods Rd  | Phone:  v622-5578 / 719-535-5578
0419/117 - LEC Access ; D5-1010   | FAX:    719-535-1665
Colo Springs, CO  80919    | 1800PageMCI / 1406052
AIM : mgpaulus1    /  sametime : mark.paulus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mark.paulus.vcf
Type: text/x-vcard
Size: 296 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20060405/7e98e6f2/attachment.vcf 


More information about the mythtv-dev mailing list