diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-06-20 09:24:05 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2011-06-20 09:24:05 +0000 |
commit | 1645e828608b213b81de18a24f5a2e95312f9237 (patch) | |
tree | c787bb93154683716b891e0ef0b6590dad60d916 /src/util/connection.c | |
parent | f4bd32a45ef30a25b17c013f72d2a2453eb03e3d (diff) |
Mantis 1716:
git-svn-id: https://gnunet.org/svn/gnunet@15722 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/connection.c')
-rw-r--r-- | src/util/connection.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/connection.c b/src/util/connection.c index 80f2cae7f8..ef38d99a9f 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -301,6 +301,23 @@ void GNUNET_CONNECTION_persist_(struct GNUNET_CONNECTION_Handle *sock) sock->persist = GNUNET_YES; } + +/** + * Disable the "CORK" feature for communication with the given socket, + * forcing the OS to immediately flush the buffer on transmission + * instead of potentially buffering multiple messages. Essentially + * reduces the OS send buffers to zero. + * Used to make sure that the last messages sent through the connection + * reach the other side before the process is terminated. + * + * @param sock the connection to make flushing and blocking + * @return GNUNET_OK on success + */ +int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock) +{ + return GNUNET_NETWORK_socket_disable_corking (sock->sock); +} + /** * Create a socket handle by boxing an existing OS socket. The OS * socket should henceforth be no longer used directly. |