Cafu Engine
Network.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_NETWORK_HPP_INCLUDED
8 #define CAFU_NETWORK_HPP_INCLUDED
9 
10 #include <string>
11 
12 // TODO: K├Ânnen wir diesen #if... Teil in das Network.cpp File verlagern?
13 #ifdef _WIN32
14 #define WIN32_LEAN_AND_MEAN
15 #include <winsock2.h>
16 #define socklen_t int
17 #undef GetProp
18 #else
19 #include <string.h>
20 #include <netinet/in.h>
21 #include <unistd.h>
22 #define SOCKET int
23 #define INVALID_SOCKET -1
24 #define SOCKET_ERROR -1
25 #define closesocket close
26 #define WSAGetLastError() errno
27 #endif
28 
29 #include "Templates/Array.hpp"
30 
31 #if defined(_WIN32) && _MSC_VER<1600
32 #include "pstdint.h" // Paul Hsieh's portable implementation of the stdint.h header.
33 #else
34 #include <stdint.h>
35 #endif
36 
37 
38 /// Network error (all other exceptions of this library derive from this one).
39 struct NetworkError { };
40 
41 
42 /// This class simplifies the usage of the WinSock API.
43 class WinSockT
44 {
45  private:
46 
47  WinSockT(const WinSockT&); // Use of the Copy Constructor is not allowed
48  void operator = (const WinSockT&); // Use of the Assignment Operator is not allowed
49 
50 
51  public:
52 
53  /// WinSock initialization error.
54  struct InitFailure : public NetworkError
55  {
56  int Error; ///< Error code.
57 
58  /// Constructor.
59  /// @param Error_ Error code.
60  InitFailure(unsigned long Error_) : Error(Error_) { }
61  };
62 
63  /// Bad version error.
64  struct BadVersion : public NetworkError
65  {
66  unsigned short Version; ///< The bad version number.
67 
68  /// Constructor.
69  /// @param Version_ Bad version number.
70  BadVersion(unsigned short Version_) : Version(Version_) { }
71  };
72 
73  /// Constructor: Initializes WinSock.
74  /// @param RequestedVersion WinSock version to request.
75  /// @throws InitFailure on failure
76  /// @throws BadVersion if the requested version is not supported.
77  WinSockT(unsigned short RequestedVersion=0x0002);
78 
79  /// Shuts down WinSock properly by calling WSACleanup().
80  ~WinSockT();
81 
82  /// Creates a non-blocking TCP/IP listener socket, that is bound to port PortNr.
83  /// @param PortNr The port number number to bind this listener socket to.
84  SOCKET GetTCPServerSocket(unsigned short PortNr) const;
85 
86  /// Creates a non-blocking TCP/IP socket that is connected to ServerPortNr at ServerAddr.
87  /// @param ServerAddress The server address to connect to.
88  /// @param ServerPortNr The port number number to connect to.
89  SOCKET GetTCPClientSocket(const char* ServerAddress, unsigned short ServerPortNr) const;
90 
91  /// Creates a non-blocking UDP socket that is bound to port PortNr.
92  /// @param PortNr The port number this UDP socket is bound to.
93  SOCKET GetUDPSocket(unsigned short PortNr) const;
94 };
95 
96 
97 /// Network address consisting of an IP4 address and port number.
99 {
100  public:
101 
102  /// Exception that is thrown on name look-up failure
103  struct BadHostName : public NetworkError { };
104 
105  /// Constructor.
106  /// @param IP0 The first byte of the IP address.
107  /// @param IP1 The second byte of the IP address.
108  /// @param IP2 The third byte of the IP address.
109  /// @param IP3 The fourth byte of the IP address.
110  /// @param Port_ The port of this network adress
111  NetAddressT(char IP0, char IP1, char IP2, char IP3, unsigned short Port_);
112 
113  /// Constructor.
114  /// @param Name Hostname from which the network address should be created.
115  /// @param Port_ The port of this network address.
116  /// @throw BadHostName
117  NetAddressT(const char* Name, unsigned short Port_);
118 
119  /// Constructor.
120  /// @param Name Hostname from which the network address should be created.
121  /// @param Port_ The port of this network address.
122  /// @throw BadHostName
123  NetAddressT(const std::string& Name, unsigned short Port_);
124 
125  /// Constructor.
126  /// @param SockAddrIn sockaddr_in stuct from which this network address is created.
127  NetAddressT(const sockaddr_in& SockAddrIn);
128 
129  /// Converts the network address into a string.
130  /// @return The network address in string format.
131  const char* ToString() const;
132 
133  /// Converts the network address into a sockaddr_in struct.
134  /// @return The network address as sockaddr_in.
135  sockaddr_in ToSockAddrIn() const;
136 
137  /// Compares two network addresses.
138  /// @param Address The address to compare to.
139  /// @return 'true' if the addresses are the same.
140  bool operator == (const NetAddressT& Address) const;
141 
142  /// Compares two network addresses.
143  /// @param Address The address to compare to.
144  /// @return 'true' if the addresses are different.
145  bool operator != (const NetAddressT& Address) const;
146 
147 
148  char IP[4]; ///< The IP number of the network address.
149  unsigned short Port; ///< The port number of the network address.
150 };
151 
152 
153 /// A socket that closes itself at the end of its livetime (scope).
155 {
156  public:
157 
158  /// Constructor.
159  /// Create a NetSockeT from a socket handle.
160  /// @param Socket_ Socket handle to create from.
161  NetSocketT(SOCKET Socket_);
162 
163  /// Desctructor.
164  /// Releases the socket handle it was created with.
165  ~NetSocketT();
166 
167  /// Get the socket handle.
168  /*SOCKET*/ operator SOCKET () const;
169 
170 
171  private:
172 
173  NetSocketT(const NetSocketT&); ///< Use of the Copy Constructor is not allowed.
174  void operator = (const NetSocketT&); ///< Use of the Assignment Operator is not allowed.
175 
176  SOCKET Socket;
177 };
178 
179 
180 /// Class that allows easy and portable handling, sending and receiving of data over a network.
181 class NetDataT
182 {
183  public:
184 
185  /// WinSock error.
187  {
188  /// Constructor.
189  /// @param Error_ Error code.
190  WinSockAPIError(unsigned long Error_) : Error(Error_), Address(0, 0, 0, 0, 0) { }
191 
192  /// Constructor.
193  /// @param Error_ Error code.
194  /// @param Address_ Remote address of this error.
195  WinSockAPIError(unsigned long Error_, const NetAddressT& Address_) : Error(Error_), Address(Address_) { }
196 
197  unsigned long Error; ///< Error code.
198  NetAddressT Address; ///< Remote address on which this error occured.
199  };
200 
201  /// Message length error.
202  /// Could not read as many bytes as requested.
203  struct MessageLength : public NetworkError
204  {
205  unsigned long Wanted; ///< Bytes wanted to read.
206  unsigned long Actual; ///< Actually read bytes.
207 
208  /// Constructor.
209  /// @param Wanted_ Bytes wanted to read.
210  /// @param Actual_ Actually read bytes.
211  MessageLength(unsigned long Wanted_, unsigned long Actual_) : Wanted(Wanted_), Actual(Actual_) { }
212  };
213 
214 
215  ArrayT<char> Data; ///< Data buffer contents.
216  unsigned long ReadPos; ///< Reading position in data.
217  bool ReadOfl; ///< Whether the attempt was made to read over the data buffer boundaries.
218 
219 
220  /// Constructor.
221  NetDataT() : ReadPos(0), ReadOfl(false)
222  {
223  }
224 
225  /// Initializes reading of the data buffer.
226  void ReadBegin()
227  {
228  ReadPos=0;
229  ReadOfl=false;
230  }
231 
232  /// Reads one Byte (8 Bit) from the data buffer.
233  /// @return Byte read.
234  char ReadByte()
235  {
236  if (ReadPos+1>Data.Size()) { ReadOfl=true; return 0; }
237 
238  char b=Data[ReadPos];
239 
240  ReadPos+=1;
241  return b;
242  }
243 
244  /// Read one Word (16 Bit) from the data buffer.
245  /// @return Word read.
246  unsigned short ReadWord()
247  {
248  if (ReadPos+2>Data.Size()) { ReadOfl=true; return 0; }
249 
250  unsigned short w=*(unsigned short*)&Data[ReadPos];
251 
252  ReadPos+=2;
253  return ntohs(w);
254  }
255 
256  /// Reads one uint32_t from the data buffer.
257  /// @return The read unsigned integer.
258  uint32_t ReadLong()
259  {
260  if (ReadPos+4>Data.Size()) { ReadOfl=true; return 0; }
261 
262  const uint32_t ui=*(uint32_t*)&Data[ReadPos];
263 
264  ReadPos+=4;
265  return ntohl(ui);
266  }
267 
268  /// Reads one Float (32 Bit) from the data buffer.
269  /// @return Float value read.
270  float ReadFloat()
271  {
272  const uint32_t ui=ReadLong();
273 
274  return *(float*)&ui;
275  }
276 
277  /// Reads a String from the data buffer.
278  /// @return String read.
279  const char* ReadString()
280  {
281  const unsigned long StringStart=ReadPos;
282 
283  // Figure out if the terminating 0 character is present.
284  // This is really important in order to guard against attacks.
285  while (true)
286  {
287  if (ReadPos>=Data.Size()) { ReadOfl=true; return NULL; }
288  if (Data[ReadPos]==0) break;
289  ReadPos++;
290  }
291 
292  ReadPos++;
293  return &Data[StringStart];
294  }
295 
296  /// Reads a delta message for cf::Network::StateT from the data buffer.
297  /// @return Delta message read.
299  {
300  ArrayT<uint8_t> DMsg;
301 
302  DMsg.PushBackEmptyExact(ReadLong());
303  for (unsigned long i=0; i<DMsg.Size(); i++) DMsg[i]=ReadByte();
304 
305  return DMsg;
306  }
307 
308  /// Writes one Byte (8 Bit) into the data buffer.
309  /// @param b Byte to write.
310  void WriteByte(char b)
311  {
312  Data.PushBack(b);
313  }
314 
315  /// Writes one Word (16 Bit) into the data buffer.
316  /// @param w Word to write.
317  void WriteWord(unsigned short w)
318  {
319  Data.PushBackEmpty(2);
320  *(unsigned short*)&Data[Data.Size()-2]=htons(w);
321  }
322 
323  /// Writes one uint32_t into the data buffer.
324  /// @param ui The 32-bit unsigned integer to write.
325  void WriteLong(uint32_t ui)
326  {
327  Data.PushBackEmpty(4);
328  *(uint32_t*)&Data[Data.Size()-4]=htonl(ui);
329  }
330 
331  /// Writes one float (32 Bit) into the data buffer.
332  /// @param f Float to write.
333  void WriteFloat(float f)
334  {
335  WriteLong(*(uint32_t*)&f);
336  }
337 
338  /// Writes a String into the data buffer.
339  /// @param String String to write.
340  void WriteString(const char* String)
341  {
342  if (!String) return;
343 
344  const unsigned long Start =Data.Size();
345  const unsigned long Length=(unsigned long)strlen(String)+1;
346 
347  Data.PushBackEmpty(Length);
348  memcpy(&Data[Start], String, Length);
349  }
350 
351  /// Writes a String into the data buffer.
352  /// @param String String to write.
353  void WriteString(const std::string& String)
354  {
355  WriteString(String.c_str());
356  }
357 
358  /// Writes an ArrayT<char> into the data buffer.
359  /// @param AoB Byte array to write.
361  {
362  for (unsigned long i=0; i<AoB.Size(); i++) Data.PushBack(AoB[i]);
363  }
364 
365  /// Writes a delta message as created by cf::Network::StateT into the data buffer.
366  /// @param DMsg Delta message to write.
367  void WriteDMsg(const ArrayT<uint8_t>& DMsg)
368  {
369  WriteLong(DMsg.Size());
370  for (unsigned long i=0; i<DMsg.Size(); i++) Data.PushBack(DMsg[i]);
371  }
372 
373 
374  /// Send the content of NetDataT through 'Socket' (non-blocking UDP socket) to 'ReceiverAddress'.
375  /// @param Socket The socket to send the data through.
376  /// @param ReceiverAddress The address of the receiver.
377  /// @throw WinSockAPIError if theres a WinSock API error
378  /// @throw MessageLength when the message was not completely sent.
379  void Send(SOCKET Socket, const NetAddressT& ReceiverAddress) const;
380 
381  /// Receives one packet from 'Socket' (non-blocking UDP socket), overwrites the content of this NetDataT and
382  /// returns the NetAddressT of the sender.
383  /// @param Socket The socket to receive the data from.
384  /// @throw WinSockAPIError, when receicing failes.
385  NetAddressT Receive(SOCKET Socket);
386 };
387 
388 
389 /// This class implements a mixture of a reliable and unreliable, bi-directional network protocol for Cafu.
390 /// Focus is on delivering unreliable messages fast and reliable messages reliable (excatly once and in order).
392 {
393  private:
394 
395  /// Flag for reliable message acknowledgements
396  static const unsigned long ACK_FLAG;
397 
398  /// Bit mask (bit-wise inverse of the ACK_FLAG)
399  static const unsigned long ACK_MASK;
400 
401  /// Maximum message size that can be sent over the network (1400 bytes for IPv6 compliance)
402  static const unsigned long MAX_MSG_SIZE;
403 
404  /// Number of the next packet to be sent to the remote party: >> Hey, I am sending you a packet with sequence number 'NextOutgoingSequenceNr'! <<
405  unsigned long NextOutgoingSequenceNr;
406 
407  /// Number of the last packet we got from the remote party: >> The last packet I have seen from you had sequence number 'LastIncomingSequenceNr'! <<
408  unsigned long LastIncomingSequenceNr;
409 
410  /// Number of the last packet we sent that carried a reliable message payload (only one such packet can be in-flight at a time)
411  unsigned long LastReliableSequenceNr;
412 
413  /// A single bit only: The alternating bit we expect to receive for reliable message acknowledgement
414  unsigned long ExpectedIncomingAckBit;
415 
416  /// A single bit only: The alternating bit we are expected to send for reliable message acknowledgement
417  unsigned long ExpectedOutgoingAckBit;
418 
419  /// The flag that indicates if the reliable data is to be resent (either when the data is new or packet loss was detected)
420  bool ResendReliableDataInFlight;
421 
422  /// The data that is currently being transmitted reliable
423  ArrayT<char> ReliableDataInFlight;
424 
425  /// The data that is waiting to be transmitted reliable, once the old 'in-flight' data was received by the remote party
426  ArrayT< ArrayT<char> > ReliableDatasQueue;
427 
428 
429  public:
430 
431  /// The exception that might be thrown on failure of the GetTransmitData() method
432  struct MaxMsgSizeExceeded : public NetworkError { };
433 
434  /// Create a connection over the GameProtocol1T.
435  GameProtocol1T();
436 
437  /// This function takes 'ReliableDatas' and 'UnreliableData' and returns a 'NetDataT' object created from them that can be sent
438  /// to the address of the protocol remote client.
439  /// Note: 'ReliableDatas' is an array of arrays by intention. Its elements, e.g. 'ReliableDatas[i]', should consists of small self contained
440  /// "reliable messages". This is necessary so the function has a clue where to cut the complete message. Examples:
441  /// a) The sum of the data in 'ReliableDatas' is to great for a single network packet, but each component ('ReliableDatas[i]') is small enough.
442  /// b) Because of network problems more and more "reliable messages" are jammed.
443  /// In both cases this function takes as many data from the queue as possible at the borders of whole 'ReliableDatas[i]'.
444  /// The ONLY failure case (exception 'MaxMsgSizeExceeded') occurs if any 'ReliableDatas[i]' exceeds the maximal possible network packet size.
445  /// This should NEVER happen.
446  /// @param ReliableDatas Reliable data parts from which the NetDataT is build.
447  /// @param UnreliableData Unreliable data from which the NetDataT is build.
448  /// @return NetDataT object ready to send over the network.
449  const NetDataT& GetTransmitData(const ArrayT< ArrayT<char> >& ReliableDatas, const ArrayT<char>& UnreliableData) /*throw (MaxMsgSizeExceeded)*/;
450 
451  /// Passes the data ('Payload') that has been received from our protocol remote client to ProcessPayload() for evaluation.
452  /// If an error occurs (e.g. InData not usable because obsolete) 0 is returned.
453  /// Otherwise the return value is the last SequenceNr that the remote client has seen from us (RemoteLastIncomingSequenceNr).
454  /// @param InData The data received from a remote client.
455  /// @param ProcessPayload The function used to process the payload.
456  /// @return The last SequenceNr that the remote client has seen from us (RemoteLastIncomingSequenceNr)
457  unsigned long ProcessIncomingMessage(NetDataT& InData, void (*ProcessPayload)(NetDataT& /*Payload*/, unsigned long /*LastIncomingSequenceNr*/));
458 
459  /// Returns the sequence number of the next packet sent to the remote client that is not-out-of-band.
460  /// @return The sequence number of the next packet sent to the remote client that is not-out-of-band.
461  unsigned long GetNextOutgoingSequenceNr() { return NextOutgoingSequenceNr; }
462 
463  /// Returns NetDataT with 'UnreliableData' as 'out-of-band' message. NetData can then be sent to the protocol remote client.
464  /// @param UnreliableData The unrelilable data to create a NetDataT object from.
465  /// @return The NetDataT object created from UnreliableData.
466  static const NetDataT& GetTransmitOutOfBandData(const ArrayT<char>& UnreliableData);
467 
468  /// Returns true if 'InData' is a 'out-of-band' message, 'false' otherwise.
469  /// If 'true', 'InData' is changed in a way that after this call the payload can be read directly.
470  /// @param InData NetDataT to check.
471  /// @return True if InData is a 'out-of-band' message, false otherwise.
472  static bool IsIncomingMessageOutOfBand(NetDataT& InData);
473 };
474 
475 #endif
Exception that is thrown on name look-up failure.
Definition: Network.hpp:103
sockaddr_in ToSockAddrIn() const
Converts the network address into a sockaddr_in struct.
Definition: Network.cpp:185
NetAddressT(char IP0, char IP1, char IP2, char IP3, unsigned short Port_)
Constructor.
Definition: Network.cpp:117
Network address consisting of an IP4 address and port number.
Definition: Network.hpp:98
WinSockAPIError(unsigned long Error_)
Constructor.
Definition: Network.hpp:190
GameProtocol1T()
Create a connection over the GameProtocol1T.
Definition: Network.cpp:290
This class implements a mixture of a reliable and unreliable, bi-directional network protocol for Caf...
Definition: Network.hpp:391
void ReadBegin()
Initializes reading of the data buffer.
Definition: Network.hpp:226
Message length error.
Definition: Network.hpp:203
static bool IsIncomingMessageOutOfBand(NetDataT &InData)
Returns true if 'InData' is a 'out-of-band' message, 'false' otherwise.
Definition: Network.cpp:437
bool operator==(const NetAddressT &Address) const
Compares two network addresses.
Definition: Network.cpp:202
NetAddressT Address
Remote address on which this error occured.
Definition: Network.hpp:198
void WriteWord(unsigned short w)
Writes one Word (16 Bit) into the data buffer.
Definition: Network.hpp:317
unsigned long Actual
Actually read bytes.
Definition: Network.hpp:206
void Send(SOCKET Socket, const NetAddressT &ReceiverAddress) const
Send the content of NetDataT through 'Socket' (non-blocking UDP socket) to 'ReceiverAddress'.
Definition: Network.cpp:245
void WriteArrayOfBytes(const ArrayT< char > &AoB)
Writes an ArrayT<char> into the data buffer.
Definition: Network.hpp:360
WinSock error.
Definition: Network.hpp:186
unsigned long Size() const
Get size of array.
Definition: Array.hpp:138
MessageLength(unsigned long Wanted_, unsigned long Actual_)
Constructor.
Definition: Network.hpp:211
This class simplifies the usage of the WinSock API.
Definition: Network.hpp:43
void WriteString(const std::string &String)
Writes a String into the data buffer.
Definition: Network.hpp:353
void WriteDMsg(const ArrayT< uint8_t > &DMsg)
Writes a delta message as created by cf::Network::StateT into the data buffer.
Definition: Network.hpp:367
unsigned long Wanted
Bytes wanted to read.
Definition: Network.hpp:205
~WinSockT()
Shuts down WinSock properly by calling WSACleanup().
Definition: Network.cpp:35
WinSock initialization error.
Definition: Network.hpp:54
BadVersion(unsigned short Version_)
Constructor.
Definition: Network.hpp:70
unsigned long Error
Error code.
Definition: Network.hpp:197
NetDataT()
Constructor.
Definition: Network.hpp:221
bool operator!=(const NetAddressT &Address) const
Compares two network addresses.
Definition: Network.cpp:211
const NetDataT & GetTransmitData(const ArrayT< ArrayT< char > > &ReliableDatas, const ArrayT< char > &UnreliableData)
This function takes 'ReliableDatas' and 'UnreliableData' and returns a 'NetDataT' object created from...
Definition: Network.cpp:305
float ReadFloat()
Reads one Float (32 Bit) from the data buffer.
Definition: Network.hpp:270
int Error
Error code.
Definition: Network.hpp:56
const char * ReadString()
Reads a String from the data buffer.
Definition: Network.hpp:279
char ReadByte()
Reads one Byte (8 Bit) from the data buffer.
Definition: Network.hpp:234
SOCKET GetTCPClientSocket(const char *ServerAddress, unsigned short ServerPortNr) const
Creates a non-blocking TCP/IP socket that is connected to ServerPortNr at ServerAddr.
Definition: Network.cpp:66
Class that allows easy and portable handling, sending and receiving of data over a network...
Definition: Network.hpp:181
unsigned short ReadWord()
Read one Word (16 Bit) from the data buffer.
Definition: Network.hpp:246
NetSocketT(SOCKET Socket_)
Constructor.
Definition: Network.cpp:225
The exception that might be thrown on failure of the GetTransmitData() method.
Definition: Network.hpp:432
NetAddressT Receive(SOCKET Socket)
Receives one packet from 'Socket' (non-blocking UDP socket), overwrites the content of this NetDataT ...
Definition: Network.cpp:259
unsigned long GetNextOutgoingSequenceNr()
Returns the sequence number of the next packet sent to the remote client that is not-out-of-band.
Definition: Network.hpp:461
A socket that closes itself at the end of its livetime (scope).
Definition: Network.hpp:154
Network error (all other exceptions of this library derive from this one).
Definition: Network.hpp:39
static const NetDataT & GetTransmitOutOfBandData(const ArrayT< char > &UnreliableData)
Returns NetDataT with 'UnreliableData' as 'out-of-band' message.
Definition: Network.cpp:426
unsigned short Version
The bad version number.
Definition: Network.hpp:66
Bad version error.
Definition: Network.hpp:64
uint32_t ReadLong()
Reads one uint32_t from the data buffer.
Definition: Network.hpp:258
const char * ToString() const
Converts the network address into a string.
Definition: Network.cpp:177
void WriteLong(uint32_t ui)
Writes one uint32_t into the data buffer.
Definition: Network.hpp:325
SOCKET GetTCPServerSocket(unsigned short PortNr) const
Creates a non-blocking TCP/IP listener socket, that is bound to port PortNr.
Definition: Network.cpp:42
ArrayT< char > Data
Data buffer contents.
Definition: Network.hpp:215
unsigned long ProcessIncomingMessage(NetDataT &InData, void(*ProcessPayload)(NetDataT &, unsigned long))
Passes the data ('Payload') that has been received from our protocol remote client to ProcessPayload(...
Definition: Network.cpp:382
void WriteByte(char b)
Writes one Byte (8 Bit) into the data buffer.
Definition: Network.hpp:310
unsigned short Port
The port number of the network address.
Definition: Network.hpp:149
void WriteFloat(float f)
Writes one float (32 Bit) into the data buffer.
Definition: Network.hpp:333
void WriteString(const char *String)
Writes a String into the data buffer.
Definition: Network.hpp:340
InitFailure(unsigned long Error_)
Constructor.
Definition: Network.hpp:60
unsigned long ReadPos
Reading position in data.
Definition: Network.hpp:216
char IP[4]
The IP number of the network address.
Definition: Network.hpp:148
ArrayT< uint8_t > ReadDMsg()
Reads a delta message for cf::Network::StateT from the data buffer.
Definition: Network.hpp:298
bool ReadOfl
Whether the attempt was made to read over the data buffer boundaries.
Definition: Network.hpp:217
SOCKET GetUDPSocket(unsigned short PortNr) const
Creates a non-blocking UDP socket that is bound to port PortNr.
Definition: Network.cpp:89
~NetSocketT()
Desctructor.
Definition: Network.cpp:230
WinSockAPIError(unsigned long Error_, const NetAddressT &Address_)
Constructor.
Definition: Network.hpp:195