This commit is contained in:
Emiel Bruijntjes 2016-01-04 10:38:44 +01:00
commit 7de0fe94ac
2 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,11 @@
*/ */
#pragma once #pragma once
/**
* Dependencies
*/
#include <ev.h>
/** /**
* Set up namespace * Set up namespace
*/ */

View File

@ -112,9 +112,9 @@ private:
// connection succeeded, mark socket as non-blocking // connection succeeded, mark socket as non-blocking
if (_socket >= 0) if (_socket >= 0)
{ {
// turn socket into a non-blocking socket // turn socket into a non-blocking socket and set the close-on-exec bit
fcntl(_socket, F_SETFL, O_NONBLOCK); fcntl(_socket, F_SETFL, O_NONBLOCK | O_CLOEXEC);
// we want to enable "nodelay" on sockets (otherwise all send operations are s-l-o-w // we want to enable "nodelay" on sockets (otherwise all send operations are s-l-o-w
int optval = 1; int optval = 1;