summaryrefslogtreecommitdiff
path: root/protocols/ace/RMCast/Parameters.h
blob: d254bd00fadb57a1091e2d575a0cb0ed1c718f84 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// file      : ace/RMCast/Parameters.h
// author    : Boris Kolpackov <boris@kolpackov.net>
// cvs-id    : $Id$

#ifndef ACE_RMCAST_PARAMETERS_H
#define ACE_RMCAST_PARAMETERS_H

#include "ace/Time_Value.h"


namespace ACE_RMCast
{
  class Parameters
  {
  public:
    Parameters (
      // Loss and reordering simulator.
      //
      bool simulator = false,

      // MTU(1500) - IP-hdr - UDP-hdr
      //
      unsigned short max_packet_size = 1470,

      // How often various worker threads wakeup to do
      // cacellation checks, queue run-throughs, etc.
      //
      ACE_Time_Value const& tick  = ACE_Time_Value (0, 2000),

      // How long to wait, in ticks, before sending NAK.
      //
      unsigned long nak_timeout = 1,

      // How long to wait, in ticks, before sending NRTM.
      //
      unsigned long nrtm_timeout = 10,

      // How long to retain a message for retransmission, in ticks.
      //
      unsigned long retention_timeout = 500,  // 1 sec

      size_t addr_map_size = 50
    )
        : simulator_ (simulator),
          max_packet_size_ (max_packet_size),
          tick_ (tick),
          nak_timeout_ (nak_timeout),
          nrtm_timeout_ (nrtm_timeout),
          retention_timeout_ (retention_timeout),
          addr_map_size_(addr_map_size)
    {
    }

  public:
    bool
    simulator () const
    {
      return simulator_;
    }

    unsigned short
    max_packet_size () const
    {
      return max_packet_size_;
    }

    ACE_Time_Value const&
    tick () const
    {
      return tick_;
    }

    unsigned long
    nak_timeout () const
    {
      return nak_timeout_;
    }

    unsigned long
    nrtm_timeout () const
    {
      return nrtm_timeout_;
    }

    unsigned long
    retention_timeout () const
    {
      return retention_timeout_;
    }

    size_t
    addr_map_size () const
    {
      return addr_map_size_;
    }

  private:
    bool simulator_;
    unsigned short max_packet_size_;
    ACE_Time_Value tick_;
    unsigned long nak_timeout_;
    unsigned long nrtm_timeout_;
    unsigned long retention_timeout_;
    size_t addr_map_size_;
  };
}


#endif  // ACE_RMCAST_PARAMETERS_H