Wrapper completed & tested; adjusted many systems
This commit is contained in:
@@ -15,19 +15,21 @@ public:
|
||||
int Bind(const char* ip, int port) {
|
||||
Bind(ip, port, -1);
|
||||
}
|
||||
int Bind(IPaddress add) {
|
||||
int Bind(IPaddress* add) {
|
||||
Bind(add, -1);
|
||||
}
|
||||
|
||||
//bind to certain channel
|
||||
int Bind(const char* ip, int port, int channel);
|
||||
int Bind(IPaddress add, int channel);
|
||||
int Bind(IPaddress* add, int channel);
|
||||
void Unbind(int channel);
|
||||
|
||||
IPaddress* GetIPAddress(int channel) {
|
||||
return SDLNet_GetPeerAddress(socket, channel);
|
||||
return SDLNet_UDP_GetPeerAddress(socket, channel);
|
||||
}
|
||||
|
||||
int Send(const char* ip, int port, void* data, int len);
|
||||
int Send(IPaddress* add, void* data, int len);
|
||||
int Send(int channel, void* data, int len);
|
||||
int Receive();
|
||||
|
||||
@@ -37,12 +39,15 @@ public:
|
||||
void* GetInData() const {
|
||||
return reinterpret_cast<void*>(packIn->data);
|
||||
};
|
||||
void* GetOutPacket() const {
|
||||
UDPpacket* GetOutPacket() const {
|
||||
return packOut;
|
||||
}
|
||||
void* GetInPacket() const {
|
||||
UDPpacket* GetInPacket() const {
|
||||
return packIn;
|
||||
}
|
||||
UDPsocket GetSocket() const {
|
||||
return socket;
|
||||
}
|
||||
private:
|
||||
UDPsocket socket = nullptr;
|
||||
UDPpacket* packOut = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user