handmade/include/UDPbase.h

22 lines
499 B
C
Raw Normal View History

#pragma once
#include <string>
#include <SDL_net.h>
#define DEFAULT_MAX_PACKET_SIZE 250
class UDPbase
{
IPaddress mIPAddress;
public:
UDPbase (const char* host, const Uint16 port);
~UDPbase (void);
UDPsocket Open (void);
UDPsocket Open (const Uint16 port);
void Close (UDPsocket sock);
int Bind (UDPsocket sock, const int channel);
void Unbind (UDPsocket sock, const int channel);
std::string toString (void);
IPaddress* GetPeerAddress (UDPsocket sock, const int channel);
};