summaryrefslogtreecommitdiff
path: root/src/inet.hh
blob: 1575a17b8cc479bd1847b6eeb5839e19749224f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef INET_HH
#define INET_HH

#include "unique_fd.hh"

#include <string>
#include <string_view>
#include <vector>

class Logger;

namespace inet {

unique_fd accept(Logger* logger, int fd, bool make_nonblock = false);

bool bind_and_listen(Logger* logger,
                     std::string const& addr,
                     std::string const& port,
                     std::vector<unique_fd>* out);

}  // namespace inet

namespace unix {

unique_fd bind_and_listen(Logger* logger, std::string_view path);

}  // namespace unix

#endif  // INET_HH