-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathEndpoint.cpp
More file actions
53 lines (38 loc) · 1021 Bytes
/
Endpoint.cpp
File metadata and controls
53 lines (38 loc) · 1021 Bytes
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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <SFNUL/Endpoint.hpp>
#include <SFNUL/IpAddress.hpp>
#include <SFNUL/IpAddressImpl.hpp>
namespace sfn {
Endpoint::Endpoint() :
m_address{} {
}
Endpoint::Endpoint( const IpAddress& address, unsigned short port ) :
m_address{ address },
m_port{ port }
{
}
Endpoint::Endpoint( unsigned short port ) :
m_address{},
m_port{ port }
{
}
Endpoint::~Endpoint() {
}
IpAddress Endpoint::GetAddress() const {
return m_address;
}
void Endpoint::SetAddress( const IpAddress& address ) {
m_address = address;
}
unsigned short Endpoint::GetPort() const {
return m_port;
}
void Endpoint::SetPort( unsigned short port ) {
m_port = port;
}
bool operator==( const Endpoint& left, const Endpoint& right ) {
return ( left.GetPort() == right.GetPort() ) && ( left.GetAddress() == right.GetAddress() );
}
}