13 #ifndef __STOUT_OS_POSIX_SOCKET_HPP__
14 #define __STOUT_OS_POSIX_SOCKET_HPP__
19 #include <sys/socket.h>
35 return (error == EINTR);
44 return (error == EWOULDBLOCK || error == EAGAIN);
50 return (error == EINPROGRESS);
57 if (::fstat(fd, &statbuf) < 0) {
61 return S_ISSOCK(statbuf.st_mode) != 0;
66 #endif // __STOUT_OS_POSIX_SOCKET_HPP__
bool is_socket(int fd)
Definition: socket.hpp:54
bool is_inprogress_error(int error)
Definition: socket.hpp:48
bool S_ISSOCK(const int mode)
Definition: windows.hpp:236
ssize_t send(const os::WindowsFD &fd, const void *buf, size_t len, int flags)
Definition: socket.hpp:136
bool is_restartable_error(int error)
Definition: socket.hpp:33
ssize_t recv(const os::WindowsFD &fd, void *buf, size_t len, int flags)
Definition: socket.hpp:145
Future< Connection > connect(const network::Address &address, Scheme scheme)
Try< int_fd > accept(int_fd s)
Definition: network.hpp:31
Try< hashmap< std::string, uint64_t > > stat(const std::string &hierarchy, const std::string &cgroup, const std::string &file)
std::string error(const std::string &msg, uint32_t code)
Try< Nothing > bind(int_fd s, const Address &address)
Definition: network.hpp:46
bool is_retryable_error(int error)
Definition: socket.hpp:42