NetworkTcpServerInterface Class Reference

#include <network_ip_tcp.h>

Inheritance diagram for NetworkTcpServerInterface:

Detailed Description

An asynchronous TCP server.

Public Types

using AcceptCompletionHandler = Delegate< Result< void >(Result< void >, NetworkTcpConnectionRef)>
 

Public Member Functions

MAXON_METHOD Result< void > Start ()
 
MAXON_METHOD void Stop ()
 
MAXON_METHOD Bool IsStopped () const
 
MAXON_METHOD NetworkIpAddrPort GetLocalAddress () const
 
MAXON_METHOD AioServiceRef GetIoService () const
 
MAXON_METHOD JobQueueRef GetJobQueue () const
 

Private Member Functions

 MAXON_INTERFACE (NetworkTcpServerInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.networktcpserver")
 
- Private Member Functions inherited from AioReaderInterface
MAXON_METHOD Result< void > NotifyForRead (SocketT sockfd, Result< void > result)
 

Member Typedef Documentation

◆ AcceptCompletionHandler

using AcceptCompletionHandler = Delegate<Result<void>(Result<void>, NetworkTcpConnectionRef)>

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( NetworkTcpServerInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.networktcpserver"   
)
private

◆ Start()

MAXON_METHOD Result<void> Start ( )

Starts the server. Returns an error if the server was already started, or if it failed to set up a listening socket. After the server is successfully started, it will accept incoming connections.

◆ Stop()

MAXON_METHOD void Stop ( )

Stops the server. Afterwards the server no longer accepts incoming connections.

◆ IsStopped()

MAXON_METHOD Bool IsStopped ( ) const

Returns true if the server is not started.

◆ GetLocalAddress()

MAXON_METHOD NetworkIpAddrPort GetLocalAddress ( ) const

Returns the actual address of the local endpoint this server is bound to.

◆ GetIoService()

MAXON_METHOD AioServiceRef GetIoService ( ) const

Returns the I/O service that processes I/O operations of this server.

◆ GetJobQueue()

MAXON_METHOD JobQueueRef GetJobQueue ( ) const

Returns the job queue that runs completion handlers of this server.