Arduino DLNA Server
IPAddressAndPort.h
Go to the documentation of this file.
1 #pragma once
2 #include "IPAddress.h"
3 #include "assert.h"
4 #include "string.h"
5 
6 namespace tiny_dlna {
7 
14  IPAddressAndPort() = default;
15  IPAddressAndPort(IPAddress addr, int prt) { address = addr, port = prt; }
16  IPAddress address;
17  int port;
18 
19  const char *toString() {
20  static char result[80] = {0};
21  int n = snprintf(result, 80, "%d.%d.%d.%d:%d", address[0], address[1],
22  address[2], address[3], port);
23  assert(n < 80);
24  return result;
25  }
26 };
27 
28 } // namespace tiny_dlna
Definition: Allocator.h:6
IP Adress including Port information.
Definition: IPAddressAndPort.h:13
IPAddressAndPort(IPAddress addr, int prt)
Definition: IPAddressAndPort.h:15
int port
Definition: IPAddressAndPort.h:17
const char * toString()
Definition: IPAddressAndPort.h:19
IPAddress address
Definition: IPAddressAndPort.h:16