Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <Socket.h>
Public Member Functions | |
Socket () | |
~Socket () | |
bool | SetAsServer (int port, int numPending) |
bool | ConnectToServer (const char *ipAddr, int port) |
bool | AcceptConnection (Socket &client) |
NetResult | SendData (Packet &packet) |
NetResult | ReceiveData (Packet &packet, int *bytesRead) |
void | Disconnect () |
bool | IsConnected () const |
bool | operator== (const Socket &rhs) |
void | operator= (const Socket &rhs) |
ULT_SOCKET | GetSocket () const |
Wraps a system network socket instance.
Ult::Socket::Socket | ( | ) |
Socket constructor.
Ult::Socket::~Socket | ( | ) |
Socket destructor.
bool Ult::Socket::AcceptConnection | ( | Socket & | client | ) |
As a server, attempt to accept a connection from the given client socket, initializing it.
bool Ult::Socket::ConnectToServer | ( | const char * | ipAddr, |
int | port ) |
Initialize the socket as a client to a server at the given IP address and port number.
void Ult::Socket::Disconnect | ( | ) |
Close this socket.
|
inline |
Get the underlying system socket.
|
inline |
Return whether this socket has been initialized or not.
|
inline |
Set this socket equal to the input socket.
|
inline |
Check if this and the input socket are equal.
Attempt to receive data (nonblocking) on this socket into packet, storing the number of bytes received in bytesRead.
Send the given packet over the network via this socket.
bool Ult::Socket::SetAsServer | ( | int | port, |
int | numPending ) |
Initialize the socket as a server on the given port number, with a maximum pending-connection queue size.