-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClient.h
34 lines (29 loc) · 829 Bytes
/
Client.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "INCLUDE.H"
#define WSAERROR(FunctionNullonSucces) \
if(FunctionNullonSucces != 0) \
{ \
printf("ERROR: "#FunctionNullonSucces);\
printf(":\nCode: %i\n\n", WSAGetLastError());\
}
class Tool::Network::Client
{
public:
Client(Address6 remoteAddress, u16 localPort);
Client(Address4 remoteAddress, u16 localPort);
Client(Address6 remoteAddress, Address6 localAddress);
Client(Address4 remoteAddress, Address4 localAddress);
~Client(void);
void Send(Packet* packet);
Packet* Receive(Packet* outPacket);
Packet* Receive(b8 data);
u16 Checkout(void);
Address6 GetLastReceiveAddress(void);
u32 send(Tool::Network::Datagram* data);
int receive(WSABUF* buffer);
private:
Datagram* data;
SOCKET sock;
sockaddr_in6 lastReceiveAddress;
int length;
WSA* wsa;
};