Open 3D Engine AzNetworking API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | List of all members
AzNetworking::INetworking Class Referenceabstract

The interface for creating and working with network interfaces. More...

#include <INetworking.h>

Inherited by AzNetworking::NetworkingSystemComponent.

Public Member Functions

 AZ_RTTI (INetworking, "{6E47367B-3AA5-4CB8-A691-4910168F287A}")
 
virtual INetworkInterfaceCreateNetworkInterface (AZ::Name name, ProtocolType protocolType, TrustZone trustZone, IConnectionListener &listener)=0
 
virtual INetworkInterfaceRetrieveNetworkInterface (AZ::Name name)=0
 
virtual bool DestroyNetworkInterface (AZ::Name name)=0
 
virtual void RegisterCompressorFactory (ICompressorFactory *factory)=0
 
virtual AZStd::unique_ptr< ICompressorCreateCompressor (AZ::Name name)=0
 
virtual bool UnregisterCompressorFactory (AZ::Name name)=0
 
virtual const NetworkInterfaces & GetNetworkInterfaces () const =0
 
virtual uint32_t GetTcpListenThreadSocketCount () const =0
 
virtual AZ::TimeMs GetTcpListenThreadUpdateTime () const =0
 
virtual uint32_t GetUdpReaderThreadSocketCount () const =0
 
virtual AZ::TimeMs GetUdpReaderThreadUpdateTime () const =0
 

Detailed Description

The interface for creating and working with network interfaces.

INetworking is an Az::Interface<T> that provides applications access to higher level networking abstractions. AzNetworking::INetworking can be used to instantiate new INetworkInterfaces that can be configured to operate over either TCP or UDP, enable or disable encryption, and be assigned a trust level.

INetworking is also responsible for registering ICompressorFactory implementations. This allows a developer to have access to multiple ICompressorFactory implementations by name. The MultiplayerCompressor Gem is an example of this using the LZ4 algorithm.

Member Function Documentation

◆ CreateCompressor()

virtual AZStd::unique_ptr<ICompressor> AzNetworking::INetworking::CreateCompressor ( AZ::Name  name)
pure virtual

Creates a compressor using a registered factory looked up by name

Parameters
nameThe name of the Compressor Factory to use, must match result of factory->GetFactoryName()
Returns
A unique_ptr to the new compressor

Implemented in AzNetworking::NetworkingSystemComponent.

◆ CreateNetworkInterface()

virtual INetworkInterface* AzNetworking::INetworking::CreateNetworkInterface ( AZ::Name  name,
ProtocolType  protocolType,
TrustZone  trustZone,
IConnectionListener listener 
)
pure virtual

Creates a new network interface instance with the provided parameters. Caller does not assume ownership, instance should be destroyed by calling DestroyNetworkInterface

Parameters
namethe name to assign to this network interface
protocolTypethe type of interface to instantiate (Tcp or Udp)
trustZonethe trust level associated with this network interface (client to server or server to server)
listenerthe connection listener responsible for handling connection events
Returns
pointer to the instantiated network interface, or nullptr on error

Implemented in AzNetworking::NetworkingSystemComponent.

◆ DestroyNetworkInterface()

virtual bool AzNetworking::INetworking::DestroyNetworkInterface ( AZ::Name  name)
pure virtual

Destroys a network interface instance by name.

Parameters
namethe name of the network interface to destroy
Returns
boolean true on success or false on failure

Implemented in AzNetworking::NetworkingSystemComponent.

◆ GetNetworkInterfaces()

virtual const NetworkInterfaces& AzNetworking::INetworking::GetNetworkInterfaces ( ) const
pure virtual

Returns the raw network interfaces owned by the networking instance.

Returns
the raw network interfaces owned by the networking instance

Implemented in AzNetworking::NetworkingSystemComponent.

◆ GetTcpListenThreadSocketCount()

virtual uint32_t AzNetworking::INetworking::GetTcpListenThreadSocketCount ( ) const
pure virtual

Returns the number of sockets monitored by our TcpListenThread.

Returns
the number of sockets monitored by our TcpListenThread

Implemented in AzNetworking::NetworkingSystemComponent.

◆ GetTcpListenThreadUpdateTime()

virtual AZ::TimeMs AzNetworking::INetworking::GetTcpListenThreadUpdateTime ( ) const
pure virtual

Returns the total time spent updating our TcpListenThread.

Returns
the total time spent updating our TcpListenThread

Implemented in AzNetworking::NetworkingSystemComponent.

◆ GetUdpReaderThreadSocketCount()

virtual uint32_t AzNetworking::INetworking::GetUdpReaderThreadSocketCount ( ) const
pure virtual

Returns the number of sockets monitored by our UdpReaderThread.

Returns
the number of sockets monitored by our UdpReaderThread

Implemented in AzNetworking::NetworkingSystemComponent.

◆ GetUdpReaderThreadUpdateTime()

virtual AZ::TimeMs AzNetworking::INetworking::GetUdpReaderThreadUpdateTime ( ) const
pure virtual

Returns the total time spent updating our UdpReaderThread.

Returns
the total time spent updating our UdpReaderThread

Implemented in AzNetworking::NetworkingSystemComponent.

◆ RegisterCompressorFactory()

virtual void AzNetworking::INetworking::RegisterCompressorFactory ( ICompressorFactory factory)
pure virtual

Registers a Compressor Factory that can be used to create compressors for INetworkInterfaces

Parameters
factoryThe ICompressorFactory to register

Implemented in AzNetworking::NetworkingSystemComponent.

◆ RetrieveNetworkInterface()

virtual INetworkInterface* AzNetworking::INetworking::RetrieveNetworkInterface ( AZ::Name  name)
pure virtual

Retrieves a network interface instance by name.

Parameters
namethe name of the network interface to retrieve
Returns
pointer to the requested network interface, or nullptr on error

Implemented in AzNetworking::NetworkingSystemComponent.

◆ UnregisterCompressorFactory()

virtual bool AzNetworking::INetworking::UnregisterCompressorFactory ( AZ::Name  name)
pure virtual

Unregisters the compressor factory

Parameters
nameThe name of the Compressor factory to unregister, must match result of factory->GetFactoryName()
Returns
Whether the factory was found and unregistered

Implemented in AzNetworking::NetworkingSystemComponent.


The documentation for this class was generated from the following file: