Call this method to read no more than buf.size() bytes into buf from socket connection established with daemon.
Example of implementation: return read(fd, &buf, buf.size());
buf - buffer to which data from socket will be written
Returns bytes actually transferred or -1 in case of error.
SWIG forces to use std::vector<char> instead of traditional (void *buf, size_t len) arguments.
The reason is that SWIG automatically passes std::vector<char> to/from target language, you
do not need to write typemaps for every language that you will use.
The example of how to deal with (void *buf, size_t len) in Python can be found in SWIG
documentation, Multi-argument typemaps.