diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-12-23 16:40:11 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-02-10 13:30:08 +0100 |
commit | ba9d73268f9585d4b9254adcf54708f88222798b (patch) | |
tree | 7817023a5deab6c4bcb0de90b748e49dc026f1ab /COPYING | |
parent | dec9b5e850c6aad989e814aea5b630b36f55d580 (diff) |
net: add RAII socket and use it instead of bare SOCKET
Introduce a class to manage the lifetime of a socket - when the object
that contains the socket goes out of scope, the underlying socket will
be closed.
In addition, the new `Sock` class has a `Send()`, `Recv()` and `Wait()`
methods that can be overridden by unit tests to mock the socket
operations.
The `Wait()` method also hides the
`#ifdef USE_POLL poll() #else select() #endif` technique from higher
level code.
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions