-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathudpclient.h
29 lines (26 loc) · 843 Bytes
/
udpclient.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
#ifndef UDPCLIENT_H
#define UDPCLIENT_H
#include "client.h"
#include "socket.h"
#include "transfer.h"
class UDPClient:public Client
{
Socket& socket;
unsigned short port;
std::string ip;
Transfer transfer;
public:
UDPClient(Socket& socket, const std::string& ip, unsigned short port);
OperationResult Send(size_t size, Buffer& buff, bool confirm = true);
OperationResult Send(size_t size, bool confirm = true);
OperationResult Recieve(size_t size, Buffer& buff, bool confirm = true);
OperationResult Recieve(size_t size, bool confirm);
OperationResult Peek(size_t size, Buffer& buff);
OperationResult Peek(size_t size);
Socket& getSocket();
bool isReachable();
void endTransfer();
void setIp(const std::string& ip);
void setPort(unsigned short port);
};
#endif // UDPCLIENT_H