23 #include "common_priv.h"
27 #include <sys/types.h>
28 #include <sys/socket.h>
38 for (SockAddrList::const_iterator itr = addrs.begin();
39 itr != addrs.end(); ++itr) {
40 success =
Listen(*itr, queuelength, error);
58 addr->
GetLen() =
sizeof(sockaddr_storage);
61 nfd = accept(
FD(), 0, 0);
105 int nfd = socket(address.
Family(), SOCK_STREAM, 0);
112 if (setsockopt(nfd, SOL_SOCKET, SO_REUSEADDR, &opt,
sizeof(opt)) < 0) {
120 if (listen(nfd, queuelength) < 0) {
void Listen(const SocketAddress &addr, int queuelength=256)
An abstraction of a socket address with convenience methods.
std::vector< SocketAddress > SockAddrList
bool Readable() const
Gives the current readability status of the file.