Zusi 3 TCP Protocol Library
An implementation of the Zusi 3 TCP protocol in C++.
Public Member Functions | List of all members
zusi::Socket Class Referenceabstract

Abstract interface for a socket. More...

#include <Zusi3TCP.h>

Inherited by zusi::DebugSocket, and zusi::WinsockBlockingSocket.

Public Member Functions

virtual int ReadBytes (void *dest, int bytes)=0
 Try to read bytes into dest from socket. More...
 
virtual int WriteBytes (const void *src, int bytes)=0
 Try to write bytes from src to socket. More...
 

Detailed Description

Abstract interface for a socket.

Member Function Documentation

virtual int zusi::Socket::ReadBytes ( void *  dest,
int  bytes 
)
pure virtual

Try to read bytes into dest from socket.

Method should block until all requested bytes are read, or the stream ends

Parameters
destData buffer to write to
bytesNumber of bytes to read
Returns
Number of bytes read

Implemented in zusi::WinsockBlockingSocket, and zusi::DebugSocket.

virtual int zusi::Socket::WriteBytes ( const void *  src,
int  bytes 
)
pure virtual

Try to write bytes from src to socket.

Parameters
srcData buffer to read from
bytesNumber of bytes to read
Returns
Number of bytes successfully written

Implemented in zusi::WinsockBlockingSocket, and zusi::DebugSocket.


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