From 07e2bea1fe5f2250b778b871fe1c78568a0fbc2c Mon Sep 17 00:00:00 2001 From: puvvadar Date: Mon, 2 Aug 2021 17:41:09 -0700 Subject: [PATCH 1/5] Add connection interface timeout config and remove Ctrl+G timer Signed-off-by: puvvadar --- .../AzNetworking/Framework/INetworkInterface.h | 8 ++++++++ .../TcpTransport/TcpNetworkInterface.cpp | 12 +++++++++++- .../AzNetworking/TcpTransport/TcpNetworkInterface.h | 3 +++ .../UdpTransport/UdpNetworkInterface.cpp | 12 +++++++++++- .../AzNetworking/UdpTransport/UdpNetworkInterface.h | 3 +++ .../Source/Editor/MultiplayerEditorConnection.cpp | 1 + .../Editor/MultiplayerEditorSystemComponent.cpp | 6 +----- 7 files changed, 38 insertions(+), 7 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h index d47f76ceb8..c5f79699dd 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h @@ -103,6 +103,14 @@ namespace AzNetworking //! @return boolean true on success virtual bool Disconnect(ConnectionId connectionId, DisconnectReason reason) = 0; + //! Sets whether this connection interface can disconnect by virtue of a timeout + //! @param doesTimeout If this connection interface will automatically disconnect due to a timeout + virtual void SetDoesTimeout(bool doesTimeout) = 0; + + //! Whether this connection interface will disconnect by virtue of a time out (does not account for cvars affecting all connections) + //! @return boolean true if this connection will not disconnect on timeout (does not account for cvars affecting all connections) + virtual bool DoesTimeout() = 0; + //! Const access to the metrics tracked by this network interface. //! @return const reference to the metrics tracked by this network interface const NetworkInterfaceMetrics& GetMetrics() const; diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp index f9569b5c7e..b3aeef3345 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp @@ -174,6 +174,16 @@ namespace AzNetworking return connection->Disconnect(reason, TerminationEndpoint::Local); } + void TcpNetworkInterface::SetDoesTimeout(bool doesTimeout) + { + m_doesTimeout = doesTimeout; + } + + bool TcpNetworkInterface::DoesTimeout() + { + return m_doesTimeout; + } + void TcpNetworkInterface::QueueNewConnection(const PendingConnection& pendingConnection) { m_pendingConnections.PushBackItem(pendingConnection); @@ -306,7 +316,7 @@ namespace AzNetworking { tcpConnection->SendReliablePacket(CorePackets::HeartbeatPacket()); } - else if (net_TcpTimeoutConnections) + else if (net_TcpTimeoutConnections && m_networkInterface.DoesTimeout()) { tcpConnection->Disconnect(DisconnectReason::Timeout, TerminationEndpoint::Local); return TimeoutResult::Delete; diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h index 1d590da2aa..d1e9fb67cc 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h @@ -99,6 +99,8 @@ namespace AzNetworking bool WasPacketAcked(ConnectionId connectionId, PacketId packetId) override; bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; + void SetDoesTimeout(bool doesTimeout) override; + bool DoesTimeout() override; //! @} //! Queues a new incoming connection for this network interface. @@ -154,6 +156,7 @@ namespace AzNetworking AZ::Name m_name; TrustZone m_trustZone; uint16_t m_port = 0; + bool m_doesTimeout = true; IConnectionListener& m_connectionListener; TcpConnectionSet m_connectionSet; TcpSocketManager m_tcpSocketManager; diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index a3ddb856d2..5be8594a2f 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -397,6 +397,16 @@ namespace AzNetworking return connection->Disconnect(reason, TerminationEndpoint::Local); } + void UdpNetworkInterface::SetDoesTimeout(bool doesTimeout) + { + m_doesTimeout = doesTimeout; + } + + bool UdpNetworkInterface::DoesTimeout() + { + return m_doesTimeout; + } + bool UdpNetworkInterface::IsEncrypted() const { return m_socket->IsEncrypted(); @@ -729,7 +739,7 @@ namespace AzNetworking { udpConnection->SendUnreliablePacket(CorePackets::HeartbeatPacket()); } - else if (net_UdpTimeoutConnections) + else if (net_UdpTimeoutConnections && m_networkInterface.DoesTimeout()) { udpConnection->Disconnect(DisconnectReason::Timeout, TerminationEndpoint::Local); return TimeoutResult::Delete; diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h index 7a391c152e..b2e80dc3e9 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h @@ -104,6 +104,8 @@ namespace AzNetworking bool WasPacketAcked(ConnectionId connectionId, PacketId packetId) override; bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; + void SetDoesTimeout(bool doesTimeout) override; + bool DoesTimeout() override; //! @} //! Returns true if this is an encrypted socket, false if not. @@ -179,6 +181,7 @@ namespace AzNetworking TrustZone m_trustZone; uint16_t m_port = 0; bool m_allowIncomingConnections = false; + bool m_doesTimeout = true; IConnectionListener& m_connectionListener; UdpConnectionSet m_connectionSet; TimeoutQueue m_connectionTimeoutQueue; diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index deb53bacab..db2a36ae20 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -32,6 +32,7 @@ namespace Multiplayer { m_networkEditorInterface = AZ::Interface::Get()->CreateNetworkInterface( AZ::Name(MPEditorInterfaceName), ProtocolType::Tcp, TrustZone::ExternalClientToServer, *this); + m_networkEditorInterface->SetDoesTimeout(false); if (editorsv_isDedicated) { uint16_t editorServerPort = DefaultServerEditorPort; diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 9030b150e6..d557c65215 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -147,13 +147,9 @@ namespace Multiplayer processLaunchInfo.m_showWindow = true; processLaunchInfo.m_processPriority = AzFramework::ProcessPriority::PROCESSPRIORITY_NORMAL; - // Launch the Server and give it a few seconds to boot up + // Launch the Server AzFramework::ProcessWatcher* outProcess = AzFramework::ProcessWatcher::LaunchProcess( processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE); - if (outProcess) - { - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(15000)); - } return outProcess; } From 115f669679521f6ad0d49317945dd82347a9233e Mon Sep 17 00:00:00 2001 From: puvvadar Date: Mon, 2 Aug 2021 20:31:02 -0700 Subject: [PATCH 2/5] Rename timeout functions for readability Signed-off-by: puvvadar --- .../AzNetworking/AzNetworking/Framework/INetworkInterface.h | 4 ++-- .../AzNetworking/TcpTransport/TcpNetworkInterface.cpp | 6 +++--- .../AzNetworking/TcpTransport/TcpNetworkInterface.h | 4 ++-- .../AzNetworking/UdpTransport/UdpNetworkInterface.cpp | 6 +++--- .../AzNetworking/UdpTransport/UdpNetworkInterface.h | 4 ++-- .../Code/Source/Editor/MultiplayerEditorConnection.cpp | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h index c5f79699dd..303fd3de0f 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h @@ -105,11 +105,11 @@ namespace AzNetworking //! Sets whether this connection interface can disconnect by virtue of a timeout //! @param doesTimeout If this connection interface will automatically disconnect due to a timeout - virtual void SetDoesTimeout(bool doesTimeout) = 0; + virtual void SetTimeoutEnabled(bool doesTimeout) = 0; //! Whether this connection interface will disconnect by virtue of a time out (does not account for cvars affecting all connections) //! @return boolean true if this connection will not disconnect on timeout (does not account for cvars affecting all connections) - virtual bool DoesTimeout() = 0; + virtual bool IsTimeoutEnabled() = 0; //! Const access to the metrics tracked by this network interface. //! @return const reference to the metrics tracked by this network interface diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp index b3aeef3345..26972cfa0b 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp @@ -174,12 +174,12 @@ namespace AzNetworking return connection->Disconnect(reason, TerminationEndpoint::Local); } - void TcpNetworkInterface::SetDoesTimeout(bool doesTimeout) + void TcpNetworkInterface::SetTimeoutEnabled(bool doesTimeout) { m_doesTimeout = doesTimeout; } - bool TcpNetworkInterface::DoesTimeout() + bool TcpNetworkInterface::IsTimeoutEnabled() { return m_doesTimeout; } @@ -316,7 +316,7 @@ namespace AzNetworking { tcpConnection->SendReliablePacket(CorePackets::HeartbeatPacket()); } - else if (net_TcpTimeoutConnections && m_networkInterface.DoesTimeout()) + else if (net_TcpTimeoutConnections && m_networkInterface.IsTimeoutEnabled()) { tcpConnection->Disconnect(DisconnectReason::Timeout, TerminationEndpoint::Local); return TimeoutResult::Delete; diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h index d1e9fb67cc..f041f707be 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h @@ -99,8 +99,8 @@ namespace AzNetworking bool WasPacketAcked(ConnectionId connectionId, PacketId packetId) override; bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; - void SetDoesTimeout(bool doesTimeout) override; - bool DoesTimeout() override; + void SetTimeoutEnabled(bool doesTimeout) override; + bool IsTimeoutEnabled() override; //! @} //! Queues a new incoming connection for this network interface. diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index 5be8594a2f..6be01d84ed 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -397,12 +397,12 @@ namespace AzNetworking return connection->Disconnect(reason, TerminationEndpoint::Local); } - void UdpNetworkInterface::SetDoesTimeout(bool doesTimeout) + void UdpNetworkInterface::SetTimeoutEnabled(bool doesTimeout) { m_doesTimeout = doesTimeout; } - bool UdpNetworkInterface::DoesTimeout() + bool UdpNetworkInterface::IsTimeoutEnabled() { return m_doesTimeout; } @@ -739,7 +739,7 @@ namespace AzNetworking { udpConnection->SendUnreliablePacket(CorePackets::HeartbeatPacket()); } - else if (net_UdpTimeoutConnections && m_networkInterface.DoesTimeout()) + else if (net_UdpTimeoutConnections && m_networkInterface.IsTimeoutEnabled()) { udpConnection->Disconnect(DisconnectReason::Timeout, TerminationEndpoint::Local); return TimeoutResult::Delete; diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h index b2e80dc3e9..087ed9d52f 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h @@ -104,8 +104,8 @@ namespace AzNetworking bool WasPacketAcked(ConnectionId connectionId, PacketId packetId) override; bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; - void SetDoesTimeout(bool doesTimeout) override; - bool DoesTimeout() override; + void SetTimeoutEnabled(bool doesTimeout) override; + bool IsTimeoutEnabled() override; //! @} //! Returns true if this is an encrypted socket, false if not. diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index db2a36ae20..fc398182ef 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -32,7 +32,7 @@ namespace Multiplayer { m_networkEditorInterface = AZ::Interface::Get()->CreateNetworkInterface( AZ::Name(MPEditorInterfaceName), ProtocolType::Tcp, TrustZone::ExternalClientToServer, *this); - m_networkEditorInterface->SetDoesTimeout(false); + m_networkEditorInterface->SetTimeoutEnabled(false); if (editorsv_isDedicated) { uint16_t editorServerPort = DefaultServerEditorPort; From 573fe425d7030d7aadc9149c8ff45c177798cd5c Mon Sep 17 00:00:00 2001 From: puvvadar Date: Mon, 2 Aug 2021 20:34:39 -0700 Subject: [PATCH 3/5] Also rename some variables to match renamed timeout funcs Signed-off-by: puvvadar --- .../AzNetworking/TcpTransport/TcpNetworkInterface.cpp | 6 +++--- .../AzNetworking/TcpTransport/TcpNetworkInterface.h | 4 ++-- .../AzNetworking/UdpTransport/UdpNetworkInterface.cpp | 6 +++--- .../AzNetworking/UdpTransport/UdpNetworkInterface.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp index 26972cfa0b..52c696b663 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp @@ -174,14 +174,14 @@ namespace AzNetworking return connection->Disconnect(reason, TerminationEndpoint::Local); } - void TcpNetworkInterface::SetTimeoutEnabled(bool doesTimeout) + void TcpNetworkInterface::SetTimeoutEnabled(bool timeoutEnabled) { - m_doesTimeout = doesTimeout; + m_timeoutEnabled = timeoutEnabled; } bool TcpNetworkInterface::IsTimeoutEnabled() { - return m_doesTimeout; + return m_timeoutEnabled; } void TcpNetworkInterface::QueueNewConnection(const PendingConnection& pendingConnection) diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h index f041f707be..3eb792bc7f 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h @@ -99,7 +99,7 @@ namespace AzNetworking bool WasPacketAcked(ConnectionId connectionId, PacketId packetId) override; bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; - void SetTimeoutEnabled(bool doesTimeout) override; + void SetTimeoutEnabled(bool timeoutEnabled) override; bool IsTimeoutEnabled() override; //! @} @@ -156,7 +156,7 @@ namespace AzNetworking AZ::Name m_name; TrustZone m_trustZone; uint16_t m_port = 0; - bool m_doesTimeout = true; + bool m_timeoutEnabled = true; IConnectionListener& m_connectionListener; TcpConnectionSet m_connectionSet; TcpSocketManager m_tcpSocketManager; diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index 6be01d84ed..a80cb82d03 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -397,14 +397,14 @@ namespace AzNetworking return connection->Disconnect(reason, TerminationEndpoint::Local); } - void UdpNetworkInterface::SetTimeoutEnabled(bool doesTimeout) + void UdpNetworkInterface::SetTimeoutEnabled(bool timeoutEnabled) { - m_doesTimeout = doesTimeout; + m_timeoutEnabled = timeoutEnabled; } bool UdpNetworkInterface::IsTimeoutEnabled() { - return m_doesTimeout; + return m_timeoutEnabled; } bool UdpNetworkInterface::IsEncrypted() const diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h index 087ed9d52f..0260491295 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h @@ -104,7 +104,7 @@ namespace AzNetworking bool WasPacketAcked(ConnectionId connectionId, PacketId packetId) override; bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; - void SetTimeoutEnabled(bool doesTimeout) override; + void SetTimeoutEnabled(bool timeoutEnabled) override; bool IsTimeoutEnabled() override; //! @} @@ -181,7 +181,7 @@ namespace AzNetworking TrustZone m_trustZone; uint16_t m_port = 0; bool m_allowIncomingConnections = false; - bool m_doesTimeout = true; + bool m_timeoutEnabled = true; IConnectionListener& m_connectionListener; UdpConnectionSet m_connectionSet; TimeoutQueue m_connectionTimeoutQueue; From 6964e4f7e9182871b4e6c05607d5308237564ae1 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Mon, 2 Aug 2021 20:35:44 -0700 Subject: [PATCH 4/5] Missed one variable rename Signed-off-by: puvvadar --- .../AzNetworking/AzNetworking/Framework/INetworkInterface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h index 303fd3de0f..f2ad1c03c3 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h @@ -104,8 +104,8 @@ namespace AzNetworking virtual bool Disconnect(ConnectionId connectionId, DisconnectReason reason) = 0; //! Sets whether this connection interface can disconnect by virtue of a timeout - //! @param doesTimeout If this connection interface will automatically disconnect due to a timeout - virtual void SetTimeoutEnabled(bool doesTimeout) = 0; + //! @param timeoutEnabled If this connection interface will automatically disconnect due to a timeout + virtual void SetTimeoutEnabled(bool timeoutEnabled) = 0; //! Whether this connection interface will disconnect by virtue of a time out (does not account for cvars affecting all connections) //! @return boolean true if this connection will not disconnect on timeout (does not account for cvars affecting all connections) From 00470acc1cf25636a8569d9af00b91eddd63922a Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 3 Aug 2021 09:36:39 -0700 Subject: [PATCH 5/5] Add const to timeout enabled getter Signed-off-by: puvvadar --- .../AzNetworking/AzNetworking/Framework/INetworkInterface.h | 2 +- .../AzNetworking/TcpTransport/TcpNetworkInterface.cpp | 2 +- .../AzNetworking/TcpTransport/TcpNetworkInterface.h | 2 +- .../AzNetworking/UdpTransport/UdpNetworkInterface.cpp | 2 +- .../AzNetworking/UdpTransport/UdpNetworkInterface.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h index f2ad1c03c3..09aa62f7d7 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h @@ -109,7 +109,7 @@ namespace AzNetworking //! Whether this connection interface will disconnect by virtue of a time out (does not account for cvars affecting all connections) //! @return boolean true if this connection will not disconnect on timeout (does not account for cvars affecting all connections) - virtual bool IsTimeoutEnabled() = 0; + virtual bool IsTimeoutEnabled() const = 0; //! Const access to the metrics tracked by this network interface. //! @return const reference to the metrics tracked by this network interface diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp index 52c696b663..62335a9b39 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.cpp @@ -179,7 +179,7 @@ namespace AzNetworking m_timeoutEnabled = timeoutEnabled; } - bool TcpNetworkInterface::IsTimeoutEnabled() + bool TcpNetworkInterface::IsTimeoutEnabled() const { return m_timeoutEnabled; } diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h index 3eb792bc7f..b9ea88974d 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpNetworkInterface.h @@ -100,7 +100,7 @@ namespace AzNetworking bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; void SetTimeoutEnabled(bool timeoutEnabled) override; - bool IsTimeoutEnabled() override; + bool IsTimeoutEnabled() const override; //! @} //! Queues a new incoming connection for this network interface. diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index a80cb82d03..48b3ad57e1 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -402,7 +402,7 @@ namespace AzNetworking m_timeoutEnabled = timeoutEnabled; } - bool UdpNetworkInterface::IsTimeoutEnabled() + bool UdpNetworkInterface::IsTimeoutEnabled() const { return m_timeoutEnabled; } diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h index 0260491295..949914da91 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.h @@ -105,7 +105,7 @@ namespace AzNetworking bool StopListening() override; bool Disconnect(ConnectionId connectionId, DisconnectReason reason) override; void SetTimeoutEnabled(bool timeoutEnabled) override; - bool IsTimeoutEnabled() override; + bool IsTimeoutEnabled() const override; //! @} //! Returns true if this is an encrypted socket, false if not.