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

Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from KapMirror::Transport
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 inherited from KapMirror::Transport
static std::shared_ptr< TransportactiveTransport = nullptr
 

Member Function Documentation

◆ clientConnect()

void SylphTransport::clientConnect ( const std::string &  ip,
int  port 
)
overridevirtual

Connect the client to the server.

Parameters
ipThe ip of the server
portThe port of the server

Implements KapMirror::Transport.

◆ clientConnected()

bool SylphTransport::clientConnected ( )
overridevirtual

Client is connected to the server.

Returns
True if the client is connected to the server

Implements KapMirror::Transport.

◆ clientSend()

void SylphTransport::clientSend ( const std::shared_ptr< ArraySegment< byte >> &  data)
overridevirtual

Send data to the server.

Parameters
dataThe data to send

Implements KapMirror::Transport.

◆ serverDisconnect()

void SylphTransport::serverDisconnect ( int  connectionId)
overridevirtual

Disconnect the connection.

Parameters
connectionIdThe id of the connection

Implements KapMirror::Transport.

◆ serverSend()

void SylphTransport::serverSend ( int  connectionId,
const std::shared_ptr< ArraySegment< byte >> &  data 
)
overridevirtual

Send data to the client.

Parameters
connectionIdThe id of the connection
dataThe data to send

Implements KapMirror::Transport.

◆ serverStart()

void SylphTransport::serverStart ( int  port)
overridevirtual

Start the server and listen the port.

Parameters
portThe port to listen

Implements KapMirror::Transport.


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