8#ifndef DISCORD_IPC_CPP_INCLUDE_DISCORD_IPC_CPP_SOCKET_CLIENT_HPP_
9#define DISCORD_IPC_CPP_INCLUDE_DISCORD_IPC_CPP_SOCKET_CLIENT_HPP_
12#include <sys/socket.h>
40 std::string _socket_file;
49 struct sockaddr_un _server_addr;
54 struct pollfd _fds[1];
104 std::optional<std::vector<char>>
recv_data(
int buffer_size);
119 std::optional<std::vector<char>>
recv_data(
int buffer_size,
int timeout);
bool connect()
Attempts to connect to the socket file.
~SocketClient()
Cleans up socket the socket connection.
SocketClient(const std::string &socket_file)
Creates socket connection precursor information.
std::optional< std::vector< char > > recv_data(int buffer_size, int timeout)
Receive data from socket on timeout.
bool send_data(const std::vector< char > &data)
Sends data to socket.
std::optional< std::vector< char > > recv_data(int buffer_size)
Receive data from socket.
bool close()
Attempts to close connection to socket file.
Underlying websocket communications.