event/SocketMonitor: eliminate Read(), Write()

Migrate callers to GetSocket().Read(), GetSocket.Write(), which is the
same.
This commit is contained in:
Max Kellermann
2017-11-10 20:31:32 +01:00
parent 7e16ac305d
commit 5fd2b7cc79
6 changed files with 7 additions and 40 deletions

View File

@@ -95,32 +95,3 @@ SocketMonitor::Schedule(unsigned flags) noexcept
scheduled_flags = flags;
}
SocketMonitor::ssize_t
SocketMonitor::Read(void *data, size_t length) noexcept
{
assert(IsDefined());
int flags = 0;
#ifdef MSG_DONTWAIT
flags |= MSG_DONTWAIT;
#endif
return recv(GetSocket().Get(), (char *)data, length, flags);
}
SocketMonitor::ssize_t
SocketMonitor::Write(const void *data, size_t length) noexcept
{
assert(IsDefined());
int flags = 0;
#ifdef MSG_NOSIGNAL
flags |= MSG_NOSIGNAL;
#endif
#ifdef MSG_DONTWAIT
flags |= MSG_DONTWAIT;
#endif
return send(GetSocket().Get(), (const char *)data, length, flags);
}