event/SocketMonitor: add assertions

This commit is contained in:
Max Kellermann
2013-08-07 23:56:49 +02:00
parent 0005221533
commit 0287ac794e
2 changed files with 12 additions and 0 deletions

View File

@@ -138,6 +138,8 @@ SocketMonitor::Close()
SocketMonitor::ssize_t
SocketMonitor::Read(void *data, size_t length)
{
assert(IsDefined());
int flags = 0;
#ifdef MSG_DONTWAIT
flags |= MSG_DONTWAIT;
@@ -149,6 +151,8 @@ SocketMonitor::Read(void *data, size_t length)
SocketMonitor::ssize_t
SocketMonitor::Write(const void *data, size_t length)
{
assert(IsDefined());
int flags = 0;
#ifdef MSG_NOSIGNAL
flags |= MSG_NOSIGNAL;
@@ -163,5 +167,7 @@ SocketMonitor::Write(const void *data, size_t length)
void
SocketMonitor::CommitEventFlags()
{
assert(IsDefined());
loop.WakeUp();
}