Network/ENetHost: Dismiss external peer connection if listen address is loopback

This commit is contained in:
Jérôme Leclercq
2017-09-01 15:22:27 +02:00
parent 7074876d68
commit e37a7ad5fd
2 changed files with 16 additions and 9 deletions

View File

@@ -55,8 +55,8 @@ namespace Nz
ENetPeer* Connect(const String& hostName, NetProtocol protocol = NetProtocol_Any, const String& service = "http", ResolveError* error = nullptr, std::size_t channelCount = 0, UInt32 data = 0);
inline bool Create(NetProtocol protocol, UInt16 port, std::size_t peerCount, std::size_t channelCount = 0);
bool Create(const IpAddress& address, std::size_t peerCount, std::size_t channelCount = 0);
bool Create(const IpAddress& address, std::size_t peerCount, std::size_t channelCount, UInt32 incomingBandwidth, UInt32 outgoingBandwidth);
bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount = 0);
bool Create(const IpAddress& listenAddress, std::size_t peerCount, std::size_t channelCount, UInt32 incomingBandwidth, UInt32 outgoingBandwidth);
void Destroy();
void Flush();
@@ -152,6 +152,7 @@ namespace Nz
UInt32 m_totalReceivedPackets;
UInt64 m_totalSentData;
UInt64 m_totalReceivedData;
bool m_allowsIncomingConnections;
bool m_continueSending;
bool m_isSimulationEnabled;
bool m_recalculateBandwidthLimits;