2022-01-08 18:59:40 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <SDL_net.h>
|
|
|
|
|
2022-01-08 21:23:42 -05:00
|
|
|
#define DEFAULT_MAX_PACKET_SIZE 250
|
2022-01-08 18:59:40 -05:00
|
|
|
|
|
|
|
class UDPbase
|
|
|
|
{
|
|
|
|
IPaddress addr;
|
|
|
|
public:
|
2022-01-08 21:23:42 -05:00
|
|
|
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);
|
2022-01-08 18:59:40 -05:00
|
|
|
};
|