32#include <sys/socket.h>
92 virtual void output(std::ostream &
os)
const = 0;
105inline static std::ostream &
129 operator bool()
const {
return (
bool)
builder; }
146 virtual bool listen(
int port);
153 void output(std::ostream &
os)
const override;
186 const std::string &_fname);
190 void output(std::ostream &
os)
const override;
194 std::string dir, std::string fname);
205 const std::string &
_name,
const std::string &_path);
207 void output(std::ostream &
os)
const override;
ListenSocketPtr build(const std::string &name) const
std::function< ListenSocketPtr(const std::string &name)> Builder
static bool parseIni(const std::string &value, ListenSocketConfig &retval)
ListenSocketConfig(Builder _builder)
void output(std::ostream &os) const override
size_t prepSockaddrUn(sockaddr_un &addr) const override
void output(std::ostream &os) const override
size_t prepSockaddrUn(sockaddr_un &addr) const override
void output(std::ostream &os) const override
ListenSocketUnix(const std::string &_name)
virtual size_t prepSockaddrUn(sockaddr_un &addr) const =0
void checkPathLength(const std::string &original, size_t max_len)
virtual void output(std::ostream &os) const =0
static bool bindToLoopback
static bool listeningDisabled
The following variables are only used by socket unit tests: listeningDisabled, anyListening,...
static void loopbackOnly()
static int socketCloexec(int domain, int type, int protocol)
static bool allDisabled()
static int acceptCloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
Interface for things with names.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
ListenSocketConfig listenSocketUnixAbstractConfig(std::string path)
std::unique_ptr< ListenSocket > ListenSocketPtr
ListenSocketConfig listenSocketInetConfig(int port)
ListenSocketConfig listenSocketUnixFileConfig(std::string dir, std::string fname)
static ListenSocketConfig listenSocketEmptyConfig()
const std::string & name()