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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Copyright (c) 2016-2020 Memgraph Ltd. [https://memgraph.com]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
extern "C" MGCLIENT_ON_APPLE
// MGCLIENT_ON_APPLE
// MGCLIENT_ON_LINUX
typedef long ssize_t;
// MGCLIENT_ON_WINDOWS
/// Initializes underlying resources. Has to be called at the beginning of a
/// process using socket resources.
int ;
/// Returns a descriptor referencing the new socket or MG_ERROR_SOCKET in the
/// case of any failure.
int ;
/// Checks for errors after \ref mg_socket_create call.
///
/// \param[in] sock Return value out of \ref mg_socket_create call.
/// \param[in] session A pointer to the session object to set the error
/// message if required.
///
/// \return \ref MG_ERROR in case of an error or \ref MG_SUCCESS if there is no
/// error. In the error case, session will have the underlying error message
/// set.
int ;
/// Connects the socket referred to by the sock descriptor to the address
/// specified by addr. The addrlen argument specifies the size of addr.
///
/// \return \ref MG_ERROR in case of an error or \ref MG_SUCCESS if there is no
/// error.
int ;
/// Checks for errors after \ref mg_socket_connect call.
///
/// \param[out] sock Return value out of \ref mg_socket_create call.
/// \param[in] status Return value out of \ref mg_socket_connect call.
/// \param[in] session A pointer to the session object to set the error
/// message if required.
///
/// \return \ref MG_ERROR in case of an error or \ref MG_SUCCESS if there is no
/// error. In the error case, session will have the underlying error message
/// set + value referenced by the sock will be set to MG_ERROR_SOCKET.
int ;
/// Sets options for a socket referenced with the given sock descriptor.
int ;
/// Sends len bytes from buf to the socket referenced by the sock descriptor.
ssize_t ;
/// Reads len bytes to buf from the socket referenced by the sock descriptor.
ssize_t ;
/// Waits for one of a set of file descriptors to become ready to perform I/O.
int ;
/// Creates a socket pair.
int ;
/// Closes the socket referenced by the sock descriptor.
int ;
/// Used to get a native error message after some socket call fails.
/// Has to be called immediately after the failed socket function.
char *;
/// Should be called at the end of any process which previously called the
/// \ref mg_socket_init function.
void ;
}
/* MGCLIENT_MGSOCKET_H */