R-Type
R-Type project
KapMirror::Transport Class Referenceabstract
Inheritance diagram for KapMirror::Transport:
KapMirror::SylphTransport KapMirror::TelepathyTransport

Public Member Functions

virtual bool clientConnected ()=0
 Client is connected to the server. More...
 
virtual void clientConnect (const std::string &ip, int port)=0
 Connect the client to the server. More...
 
virtual void clientDisconnect ()=0
 Disconnect the client from the server.
 
virtual void clientSend (const std::shared_ptr< ArraySegment< byte >> &data)=0
 Send data to the server. More...
 
virtual void clientEarlyUpdate ()=0
 Client Update (call this function every frame)
 
virtual void serverStart (int port)=0
 Start the server and listen the port. More...
 
virtual void serverStop ()=0
 Stop the server.
 
virtual void serverSend (int connectionId, const std::shared_ptr< ArraySegment< byte >> &data)=0
 Send data to the client. More...
 
virtual void serverDisconnect (int connectionId)=0
 Disconnect the connection. More...
 
virtual void serverEarlyUpdate ()=0
 Server Update (call this function every frame)
 

Public Attributes

Experimental::Action< void(Transport &)> onClientConnected
 
Experimental::Action< void(Transport &)> onClientDisconnected
 
Experimental::Action< void(Transport &, const std::shared_ptr< ArraySegment< byte >> &)> onClientDataReceived
 
Experimental::Action< void(Transport &, const std::shared_ptr< ArraySegment< byte >> &)> onClientDataSent
 
Experimental::Action< void(Transport &, int)> onServerConnected
 
Experimental::Action< void(Transport &, int)> onServerDisconnected
 
Experimental::Action< void(Transport &, int, const std::shared_ptr< ArraySegment< byte >> &)> onServerDataReceived
 
Experimental::Action< void(Transport &, int, const std::shared_ptr< ArraySegment< byte >> &)> onServerDataSent
 

Static Public Attributes

static std::shared_ptr< TransportactiveTransport = nullptr
 

Member Function Documentation

◆ clientConnect()

virtual void KapMirror::Transport::clientConnect ( const std::string &  ip,
int  port 
)
pure virtual

Connect the client to the server.

Parameters
ipThe ip of the server
portThe port of the server

Implemented in KapMirror::TelepathyTransport, and KapMirror::SylphTransport.

◆ clientConnected()

virtual bool KapMirror::Transport::clientConnected ( )
pure virtual

Client is connected to the server.

Returns
True if the client is connected to the server

Implemented in KapMirror::TelepathyTransport, and KapMirror::SylphTransport.

◆ clientSend()

virtual void KapMirror::Transport::clientSend ( const std::shared_ptr< ArraySegment< byte >> &  data)
pure virtual

Send data to the server.

Parameters
dataThe data to send

Implemented in KapMirror::TelepathyTransport, and KapMirror::SylphTransport.

◆ serverDisconnect()

virtual void KapMirror::Transport::serverDisconnect ( int  connectionId)
pure virtual

Disconnect the connection.

Parameters
connectionIdThe id of the connection

Implemented in KapMirror::TelepathyTransport, and KapMirror::SylphTransport.

◆ serverSend()

virtual void KapMirror::Transport::serverSend ( int  connectionId,
const std::shared_ptr< ArraySegment< byte >> &  data 
)
pure virtual

Send data to the client.

Parameters
connectionIdThe id of the connection
dataThe data to send

Implemented in KapMirror::TelepathyTransport, and KapMirror::SylphTransport.

◆ serverStart()

virtual void KapMirror::Transport::serverStart ( int  port)
pure virtual

Start the server and listen the port.

Parameters
portThe port to listen

Implemented in KapMirror::TelepathyTransport, and KapMirror::SylphTransport.


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