"Fossies" - the Fresh Open Source Software Archive

Member "ivtools-ivtools-2.0.4/src/DrawServ/ackback-handler.h" (9 Oct 2020, 2772 Bytes) of package /linux/misc/ivtools-ivtools-2.0.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ackback-handler.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 2004 Scott E. Johnston
    3  *
    4  * Permission to use, copy, modify, distribute, and sell this software and
    5  * its documentation for any purpose is hereby granted without fee, provided
    6  * that the above copyright notice appear in all copies and that both that
    7  * copyright notice and this permission notice appear in supporting
    8  * documentation, and that the names of the copyright holders not be used in
    9  * advertising or publicity pertaining to distribution of the software
   10  * without specific, written prior permission.  The copyright holders make
   11  * no representations about the suitability of this software for any purpose.
   12  * It is provided "as is" without express or implied warranty.
   13  *
   14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
   15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
   16  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
   17  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
   18  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
   19  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
   20  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   21  * 
   22  */
   23 
   24 #ifdef HAVE_ACE
   25 
   26 #ifndef _ackback_handler_
   27 #define _ackback_handler_
   28 
   29 #include <iosfwd>
   30 #include <ace/Event_Handler.h>
   31 
   32 class DrawLink;
   33 
   34 //: specialized ACE_EventHandler for monitoring responses from outgoing connection
   35 class AckBackHandler : public ACE_Event_Handler
   36 {
   37 
   38 public:
   39   // = Initialization and termination methods.
   40   AckBackHandler ();
   41 
   42   virtual ~AckBackHandler ();
   43 
   44   DrawLink* drawlink() { return _drawlink; }
   45   // get DrawLink associated with this handler
   46   void drawlink(DrawLink* link) { _drawlink = link; }
   47   // set DrawLink associated with this handler
   48 
   49   virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);
   50   // Called when input events occur (e.g., connection or data).
   51 
   52   virtual int handle_timeout (const ACE_Time_Value &tv, 
   53                   const void *arg); 
   54   // called when timer goes off.
   55 
   56   virtual int handle_close (ACE_HANDLE handle,
   57                             ACE_Reactor_Mask close_mask);
   58   // Called when a <handle_*()> method returns -1 or when the
   59   // <remove_handler> method is called on an <ACE_Reactor>.  The
   60   // <close_mask> indicates which event has triggered the
   61   // <handle_close> method callback on a particular <handle>.
   62 
   63   virtual ACE_HANDLE get_handle (void) const;
   64   // Get the I/O handle.
   65 
   66   virtual void set_handle (ACE_HANDLE);
   67   // Set the I/O handle.
   68 
   69   void start_timer();
   70   // Start timer waiting for ackback
   71 
   72 protected:
   73   DrawLink* _drawlink;
   74   int _timer_started;
   75   int _ackback_arrived;
   76   long _timerid;
   77   ACE_HANDLE _handle;
   78   int _eof_expected;
   79 
   80 };
   81 
   82 #endif /* _ackback_handler_ */
   83 
   84 #endif /* HAVE_ACE */