Re: [ROOT] - using TTimer and sockets.

From: Caius Howcroft (howcroft@hep.phy.cam.ac.uk)
Date: Tue Mar 27 2001 - 16:12:49 MEST


On Tue, 27 Mar 2001, mathes@ik3.fzk.de wrote


> 1. Create and start a timer for each new socket message you send,
>    if the timer expires, find the corresponding socket in a lookup table,
>    if the message comes back before, stop the timer, find the timer in the
>    lookup table

Is it not the case that TMonitor will block the timeout signal of TTimer?
This is what i did first.



> 2. Create a new class which inherits from TSocket and has also a TTimer
>    object in it, overwrite the Send() and Recv() method and do the timer
>    handling there.
>    Probably multiple inheritance will work also, but I don't know. Send()
>    and Recv() methods of TSocket() should be virtual (in fact they are).
>    The new class can be handled also by TMonitor you need only a 
>    dynamic_cast<>() to handle the return value of TMonitor::Select()
>    properly.
> 
> Solution 1 is what I would like to call the C-approach but eventually
> easier to debug (and more difficult to read).
>    
> Ciao
>   Hermann-Josef
> 
> 
> 

_______________________
CAIUS HOWCROFT
01223 711 788 UK(home)
07977 473 937 UK(mobile)
01223 766 300 UK(Office)



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:40 MET