Zusi 3 TCP Protocol Library
An implementation of the Zusi 3 TCP protocol in C++.
|
Socket implemented using the built-in Windows Winsock networking functions. More...
#include <WinsockBlockingSocket.h>
Inherits zusi::Socket.
Public Member Functions | |
WinsockBlockingSocket (const char *ip_address, int port) | |
Construct a new socket and initiate a TCP connection. More... | |
virtual int | ReadBytes (void *dest, int bytes) |
Try to read bytes into dest from socket. More... | |
virtual int | WriteBytes (const void *src, int bytes) |
Try to write bytes from src to socket. More... | |
Socket implemented using the built-in Windows Winsock networking functions.
If using this class, link in ws2_32.lib.
zusi::WinsockBlockingSocket::WinsockBlockingSocket | ( | const char * | ip_address, |
int | port | ||
) |
Construct a new socket and initiate a TCP connection.
ip_address | Null-terminated string of IP Address to connect to |
port | Port to connection to, usually 1436. |
std::runtime_error | system error when creating socket |
|
virtual |
Try to read bytes into dest from socket.
Method should block until all requested bytes are read, or the stream ends
dest | Data buffer to write to |
bytes | Number of bytes to read |
Implements zusi::Socket.
|
virtual |
Try to write bytes from src to socket.
src | Data buffer to read from |
bytes | Number of bytes to read |
Implements zusi::Socket.