-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSocketCommon.h
More file actions
57 lines (46 loc) · 949 Bytes
/
Copy pathSocketCommon.h
File metadata and controls
57 lines (46 loc) · 949 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include <memory>
#include <string>
namespace sockets {
/**
* @brief Default values for SO_SNDBUF and SO_RCVBUF
*
*/
constexpr int TX_BUFFER_SIZE = 10240;
constexpr int RX_BUFFER_SIZE = 10240;
/**
* @brief Status structure returned by socket class methods.
*
*/
struct SocketRet {
/**
* @brief Error message text
*/
std::string m_msg;
/**
* @brief Indication of whether the operation succeeded or failed
*/
bool m_success = false;
};
/**
* @brief Socket options to be used.
*
*/
struct SocketOpt {
/**
* @brief Value passed to setsockopt(SO_SNDBUF)
*
*/
int m_txBufSize = TX_BUFFER_SIZE;
/**
* @brief Value passed to setsockopt(SO_RCVBUF)
*
*/
int m_rxBufSize = RX_BUFFER_SIZE;
/**
* @brief Socket listen address
*
*/
std::string m_listenAddr = "0.0.0.0";
};
} // Namespace sockets