refinement of Tcp
This commit is contained in:
parent
1b310caabe
commit
a9c44dab3e
@ -38,6 +38,11 @@ public:
|
||||
|
||||
bool init() { return initialize<uv_tcp_t>(&uv_tcp_init); }
|
||||
|
||||
template<typename T, typename... Args>
|
||||
bool init(T&& t, Args&&... args) {
|
||||
return initialize<uv_tcp_t>(&uv_tcp_init_ex, std::forward<T>(t), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void noDelay(bool value = false) {
|
||||
invoke(&uv_tcp_nodelay, get<uv_tcp_t>(), value);
|
||||
}
|
||||
@ -46,6 +51,10 @@ public:
|
||||
invoke(&uv_tcp_keepalive, get<uv_tcp_t>(), enable, time.count());
|
||||
}
|
||||
|
||||
void simultaneousAccepts(bool enable = true) {
|
||||
invoke(&uv_tcp_simultaneous_accepts, get<uv_tcp_t>(), enable);
|
||||
}
|
||||
|
||||
template<typename I = IPv4>
|
||||
void bind(std::string ip, unsigned int port, Flags<Bind> flags = Flags<Bind>{}) {
|
||||
typename details::IpTraits<I>::Type addr;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user