Wizard Engine
2D cross-platform game engine built around SDL2
 
Loading...
Searching...
No Matches
wze::socket< incoming, outgoing > Class Template Referenceabstract

Generic socket. More...

#include <socket.hpp>

Public Member Functions

virtual ~socket ()=default
 
virtual ipv4 const & ipv4 () const =0
 Gets the wze::ipv4 address of the server.
 
virtual void receive (incoming &buffer)=0
 Receives data from the server.
 
virtual bool send (outgoing const &buffer)=0
 Sends data to the server.
 

Detailed Description

template<typename incoming, typename outgoing>
class wze::socket< incoming, outgoing >

Generic socket.

Template Parameters
incomingType of the incoming data.
outgoingType of the outgoing data.
See also
net
udp_socket
tcp_socket

Definition at line 45 of file socket.hpp.

Constructor & Destructor Documentation

◆ ~socket()

template<typename incoming , typename outgoing >
virtual wze::socket< incoming, outgoing >::~socket ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ ipv4()

template<typename incoming , typename outgoing >
virtual ipv4 const & wze::socket< incoming, outgoing >::ipv4 ( ) const
nodiscardpure virtual

Gets the wze::ipv4 address of the server.

Returns
wze::ipv4 address of the server.

◆ receive()

template<typename incoming , typename outgoing >
virtual void wze::socket< incoming, outgoing >::receive ( incoming & buffer)
pure virtual

Receives data from the server.

Parameters
bufferData buffer.
Returns
Integrity of the received data.
Return values
trueReceived appropriate data.
falseReceived invalid data.
Exceptions
wze::exceptionData cannot be received properly.
See also
send(outgoing const& buffer)

◆ send()

template<typename incoming , typename outgoing >
virtual bool wze::socket< incoming, outgoing >::send ( outgoing const & buffer)
pure virtual

Sends data to the server.

Parameters
bufferData buffer.
Exceptions
wze::exceptionData cannot be sent properly.
See also
receive(incoming& buffer)

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