forked from zeromq/libzmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipc_address.hpp
47 lines (34 loc) · 847 Bytes
/
ipc_address.hpp
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
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_IPC_ADDRESS_HPP_INCLUDED__
#define __ZMQ_IPC_ADDRESS_HPP_INCLUDED__
#if defined ZMQ_HAVE_IPC
#include <string>
#if defined ZMQ_HAVE_WINDOWS
#include <afunix.h>
#else
#include <sys/socket.h>
#include <sys/un.h>
#endif
#include "macros.hpp"
namespace zmq
{
class ipc_address_t
{
public:
ipc_address_t ();
ipc_address_t (const sockaddr *sa_, socklen_t sa_len_);
~ipc_address_t ();
// This function sets up the address for UNIX domain transport.
int resolve (const char *path_);
// The opposite to resolve()
int to_string (std::string &addr_) const;
const sockaddr *addr () const;
socklen_t addrlen () const;
private:
struct sockaddr_un _address;
socklen_t _addrlen;
ZMQ_NON_COPYABLE_NOR_MOVABLE (ipc_address_t)
};
}
#endif
#endif