The following fields uniquely define a Socket. In other word, Socket can't be shared between 2 different SocketMapKeys
| 47 | // The following fields uniquely define a Socket. In other word, |
| 48 | // Socket can't be shared between 2 different SocketMapKeys |
| 49 | struct SocketMapKey { |
| 50 | explicit SocketMapKey(const butil::EndPoint& pt) |
| 51 | : peer(pt) |
| 52 | {} |
| 53 | SocketMapKey(const butil::EndPoint& pt, const ChannelSignature& cs) |
| 54 | : peer(pt), channel_signature(cs) |
| 55 | {} |
| 56 | SocketMapKey(const ServerNode& sn, const ChannelSignature& cs) |
| 57 | : peer(sn), channel_signature(cs) |
| 58 | {} |
| 59 | |
| 60 | ServerNode peer; |
| 61 | ChannelSignature channel_signature; |
| 62 | }; |
| 63 | |
| 64 | inline bool operator==(const SocketMapKey& k1, const SocketMapKey& k2) { |
| 65 | return k1.peer == k2.peer && k1.channel_signature == k2.channel_signature; |
no outgoing calls