lib45d
45Drives C++ Library API Documentation
|
23 #include <45d/socket/SocketBase.hpp>
42 memset(&server_addr_, 0,
sizeof(server_addr_));
43 server_addr_.sun_family = AF_UNIX;
44 if (path.length() >=
sizeof(server_addr_.sun_path))
46 strncpy(server_addr_.sun_path, path.c_str(),
sizeof(server_addr_.sun_path) - 1);
55 int res =
::connect(
fd_, (sockaddr *)&server_addr_,
sizeof(server_addr_));
63 struct sockaddr_un server_addr_;
int io_fd_
Connection fd.
Definition: SocketBase.hpp:278
Unix Socket Client class. Used for IPC through a named socket inode.
Definition: UnixSocketClient.hpp:34
UnixSocketClient(const std::string &path)
Construct a new Unix Socket Client object.
Definition: UnixSocketClient.hpp:41
Thrown when the socket address is too long.
Definition: Exceptions.hpp:57
45Drives namespace
Definition: Bytes.hpp:27
Base Unix Socket Class for opening and closing the socket.
Definition: SocketBase.hpp:57
int fd_
File descriptor of socket.
Definition: SocketBase.hpp:277
int connect()
Make connection to socket.
Definition: UnixSocketClient.hpp:54
Thrown when connect() fails.
Definition: Exceptions.hpp:89