Go to the documentation of this file.
27 #ifndef LOCAL_SOCKET_HH_
28 # define LOCAL_SOCKET_HH_
51 void writeto(
const std::string& str,
52 const std::string& filename);
58 std::string
read(
int timeout);
60 std::string
read(std::string& filename);
63 std::string
read(std::string& filename,
int timeout);
66 std::string
readn(
unsigned int size);
69 std::string
readn(
int timeout,
unsigned int size);
72 std::string
readn(std::string& filename,
unsigned int size);
76 std::string
readn(std::string& filename,
int timeout,
unsigned int size);
179 void init(
const std::string& filename);
190 int _bind(
const std::string& filename);
199 std::string
_read_line(
int socket, std::string& filename);
209 unsigned int pkg_size);
214 void _write_str(
int socket,
const std::string& str,
215 const std::string& filename)
const;
221 const std::string& filename)
const;
std::string _read_line_bin(int socket, unsigned int size)
Get a line from socket (when used with binary protocol)
This class represent a local connection (client and server)
Network namespace represent all networks connection.
std::string _read_line(int socket)
Get a line from socket (when used with textual protocol)
void writeto(const std::string &str, const std::string &filename)
function used to send a msg to a specific named socket
void init(const std::string &filename)
Here is an example of named server server using libsocket :
enum Network::e_pkind PROTO_KIND
void _write_str(int socket, const std::string &str, const std::string &filename) const
Write a string to a socket to a particular named socket (when used with textual protocol)
std::string read()
function used by >> operator (read a string on current socket)
void close()
connect to a local socket (client)
This class represent an abstract socket connection (udp | tcp server | tcp client)
std::string readn(unsigned int size)
read a string from socket
LocalSocket(PROTO_KIND pkind)
void _write_str_bin(int socket, const std::string &str, const std::string &filename) const
Write a string to a socket to a particular named socket (when used with binary protocol)
int _bind(const std::string &filename)
Initialize a local socket connection (server in UDP) create a named socket with name filename.