~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to examples/APG/Reactor/Client.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * Client.h,v 1.2 2004/01/07 22:40:16 shuston Exp
3
 
 *
4
 
 * Sample code from The ACE Programmer's Guide,
5
 
 * copyright 2003 Addison-Wesley. All Rights Reserved.
6
 
 */
7
 
 
8
 
#ifndef __CLIENT_H_
9
 
#define __CLIENT_H_
10
 
 
11
 
#include "ace/Synch_Traits.h"
12
 
#include "ace/Null_Condition.h"
13
 
#include "ace/Null_Mutex.h"
14
 
 
15
 
// Listing 1 code/ch07
16
 
#include "ace/Reactor.h"
17
 
#include "ace/INET_Addr.h"
18
 
#include "ace/SOCK_Stream.h"
19
 
#include "ace/SOCK_Connector.h"
20
 
#include "ace/Connector.h"
21
 
#include "ace/Svc_Handler.h"
22
 
#include "ace/Reactor_Notification_Strategy.h"
23
 
 
24
 
class Client :
25
 
    public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
26
 
{
27
 
  typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> super;
28
 
 
29
 
public:
30
 
  Client () : notifier_ (0, this, ACE_Event_Handler::WRITE_MASK)
31
 
      {}
32
 
 
33
 
  virtual int open (void * = 0);
34
 
 
35
 
  // Called when input is available from the client.
36
 
  virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE);
37
 
 
38
 
  // Called when output is possible.
39
 
  virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE);
40
 
 
41
 
  // Called when a timer expires.
42
 
  virtual int handle_timeout (const ACE_Time_Value &current_time,
43
 
                              const void *act = 0);
44
 
 
45
 
private:
46
 
  enum { ITERATIONS = 5 };
47
 
  int iterations_;
48
 
  ACE_Reactor_Notification_Strategy notifier_;
49
 
};
50
 
// Listing 1
51
 
 
52
 
#endif /* __CLIENT_H_ */