summaryrefslogtreecommitdiff
path: root/ace/SOCK_Stream.h
blob: 3eceece50c2a5c97e4f6b75b205c3cd48df3446b (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* -*- C++ -*- */
// $Id$


// ============================================================================
//
// = LIBRARY
//    ace
// 
// = FILENAME
//    SOCK_Stream.h
//
// = AUTHOR
//    Doug Schmidt 
// 
// ============================================================================

#if !defined (ACE_SOCK_STREAM_H)
#define ACE_SOCK_STREAM_H

#include "ace/SOCK_IO.h"
#include "ace/INET_Addr.h"

class ACE_Export ACE_SOCK_Stream : public ACE_SOCK_IO
  // = TITLE
  //     Defines the methods in the <ACE_SOCK_Stream> abstraction.
  //     
  // = DESCRIPTION
  //     This adds additional wrapper methods atop the <ACE_SOCK_IO> class.
{
public:
  //= The following two methods use write and read system calls,
  //= which are faster than the send and recv library functions
  //= used by the following two methods.
  ssize_t send_n (const void *buf, int n) const;
  // Send n bytes, keep trying until n are sent.
  ssize_t recv_n (void *buf, int n) const;	      
  // Recv n bytes, keep trying until n are received.

  // = The following two methods use the send and recv system
  // = calls.
  ssize_t send_n (const void *buf, int n, int flags) const;
  // Send n bytes, keep trying until n are sent.
  ssize_t recv_n (void *buf, int n, int flags) const;	      
  // Recv n bytes, keep trying until n are received.

  // = Send/receive an ``urgent'' character (see TCP specs...).
  ssize_t send_urg (void *ptr, int len = sizeof (char));
  ssize_t recv_urg (void *ptr, int len = sizeof (char));

  // = Selectively close endpoints.
  int close_reader (void);
  // Close down the reader.
  int close_writer (void);
  // Close down the writer.

  // = Meta-type info
  typedef ACE_INET_Addr PEER_ADDR;

  void dump (void) const;
  // Dump the state of an object.

  ACE_ALLOC_HOOK_DECLARE;
  // Declare the dynamic allocation hooks.
};

#include "ace/SOCK_Stream.i"

#endif /* ACE_SOCK_STREAM_H */