File: iostream_server.h

package info (click to toggle)
ace 6.0.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,368 kB
  • sloc: cpp: 341,826; perl: 30,850; ansic: 20,952; makefile: 10,144; sh: 4,744; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; csh: 48; tcl: 5
file content (46 lines) | stat: -rw-r--r-- 1,355 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// $Id: iostream_server.h 91685 2010-09-09 09:35:14Z johnnyw $

// This file defines the class needed for iostream_server.cpp - it's a separate
// file to satisfy IBM's xlC template instantiation.

#ifndef __IOSTREAM_SERVER_H
#define __IOSTREAM_SERVER_H

#include "ace/INET_Addr.h"
#include "ace/IOStream.h"
#include "ace/SOCK_Stream.h"
#include "ace/Svc_Handler.h"

#if !defined (ACE_LACKS_ACE_IOSTREAM)

// Declare a new type which will case an ACE_SOCK_Stream to behave
// like an iostream.  The new ACE_SOCK_IOStream type can be used
// anywhere an ACE_SOCK_Stream is used.

typedef ACE_IOStream<ACE_SOCK_Stream> ACE_SOCK_IOStream;

class Handler : public ACE_Svc_Handler<ACE_SOCK_IOStream, ACE_NULL_SYNCH>
  // = TITLE
  //     Extend the <ACE_Svc_Handler> template to do our bidding.
  //
  // = DESCRIPTION
  //     Create an <ACE_Svc_Handler> object based on our
  //     iostream/SOCK_Stream hybrid.  All of this is fairly standard
  //     until we get to the <handle_input> where we begin using the
  //     iostream characteristics of the peer.
{
public:
  // = Initialization and termination methods.
  Handler (void);
  ~Handler (void);

  // = <Svc_Handler> hooks.
  virtual int open (void *);

  // = <Event_Handler> hooks.
  virtual int handle_input (ACE_HANDLE);
};

#endif /* ACE_LACKS_ACE_IOSTREAM */

#endif /* __IOSTREAM_SERVER_H */