proxygen
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
AcceptorAddress.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-present, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
*/
10
#pragma once
11
12
#include <
folly/SocketAddress.h
>
13
14
namespace
proxygen
{
15
16
struct
AcceptorAddress
{
17
enum class
AcceptorType
{
TCP
,
UDP
};
18
19
AcceptorAddress
() =
delete
;
20
AcceptorAddress
(
folly::SocketAddress
address
,
AcceptorType
protocol
)
21
: address(address), protocol(protocol) {
22
}
23
24
folly::SocketAddress
address
;
25
AcceptorType
protocol
;
26
};
27
28
inline
bool
operator<
(
const
AcceptorAddress
& lv,
const
AcceptorAddress
& rv) {
29
if
(lv.
address
< rv.
address
) {
30
return
true
;
31
}
32
if
(rv.
address
< lv.
address
) {
33
return
false
;
34
}
35
return
lv.
protocol
< rv.
protocol
;
36
}
37
38
inline
std::ostream&
operator<<
(std::ostream& os,
39
const
AcceptorAddress::AcceptorType
& accType) {
40
switch
(accType) {
41
case
AcceptorAddress::AcceptorType::TCP
:
42
os <<
"TCP"
;
43
break
;
44
case
AcceptorAddress::AcceptorType::UDP
:
45
os <<
"UDP"
;
46
break
;
47
default
:
48
LOG(FATAL) <<
"Unknown Acceptor type."
;
49
}
50
return
os;
51
}
52
53
inline
std::ostream&
operator<<
(std::ostream& os,
54
const
AcceptorAddress
& accAddr) {
55
os << accAddr.
address
<<
"<"
<< accAddr.
protocol
<<
">"
;
56
return
os;
57
}
58
59
using
AcceptorType
=
AcceptorAddress::AcceptorType
;
60
61
}
// namespace proxygen
proxygen::operator<<
std::ostream & operator<<(std::ostream &os, const HeaderTable &table)
Definition:
HeaderTable.cpp:254
proxygen::AcceptorAddress::address
folly::SocketAddress address
Definition:
AcceptorAddress.h:24
proxygen::AcceptorAddress::AcceptorType
AcceptorType
Definition:
AcceptorAddress.h:17
folly::SocketAddress
Definition:
SocketAddress.h:32
proxygen::AcceptorAddress::AcceptorAddress
AcceptorAddress()=delete
proxygen::AcceptorAddress::AcceptorType::TCP
proxygen::operator<
bool operator<(const AcceptorAddress &lv, const AcceptorAddress &rv)
Definition:
AcceptorAddress.h:28
proxygen::AcceptorAddress::AcceptorType::UDP
SocketAddress.h
proxygen::AcceptorAddress
Definition:
AcceptorAddress.h:16
proxygen
Definition:
ExMessageHandler.h:14
proxygen::AcceptorAddress::protocol
AcceptorType protocol
Definition:
AcceptorAddress.h:25
proxygen::AcceptorAddress::AcceptorAddress
AcceptorAddress(folly::SocketAddress address, AcceptorType protocol)
Definition:
AcceptorAddress.h:20
proxygen
lib
utils
AcceptorAddress.h
Generated by
1.8.11