Assert on endpoint failures

Summary: .

Reviewers: mferencevic, florijan

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1045
This commit is contained in:
Mislav Bradac
2017-12-12 12:25:15 +01:00
parent 0d40f6a759
commit eb272f0b67
14 changed files with 54 additions and 129 deletions

View File

@@ -49,9 +49,7 @@ class Server {
LOG(FATAL) << "Cannot bind to socket on " << endpoint.address() << " at "
<< endpoint.port();
}
if (!socket_.SetNonBlocking()) {
LOG(FATAL) << "Cannot set socket to non blocking!";
}
socket_.SetNonBlocking();
if (!socket_.Listen(1024)) {
LOG(FATAL) << "Cannot listen on socket!";
}
@@ -126,9 +124,9 @@ class Server {
s->fd(), s->endpoint().address(), s->endpoint().family(),
s->endpoint().port());
if (!s->SetTimeout(1, 0)) return std::experimental::nullopt;
if (!s->SetKeepAlive()) return std::experimental::nullopt;
if (!s->SetNoDelay()) return std::experimental::nullopt;
s->SetTimeout(1, 0);
s->SetKeepAlive();
s->SetNoDelay();
return s;
}