Skip to content

Commit

Permalink
Merge pull request #147 from ecmwf/feature/tcpListenBacklog
Browse files Browse the repository at this point in the history
increased default value of socketOptionsListenBacklog
reviewed off-line
  • Loading branch information
danovaro authored Nov 7, 2024
2 parents 9cd9faf + f12e522 commit 6e50c36
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/eckit/net/SocketOptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@
*/

#include <ostream>
#include <sys/socket.h>

#include "eckit/config/Resource.h"
#include "eckit/net/SocketOptions.h"

namespace eckit::net {

static void init(SocketOptions& opts) {
static std::string bindAddr = Resource<std::string>("localBindingAddress", ""); /* "127.0.0.1" */

opts.bindAddress(bindAddr);

static int ListenBacklog = eckit::Resource<int>("socketOptionsListenBacklog", 5);

opts.listenBacklog(ListenBacklog);
static std::string bindAddr = Resource<std::string>("localBindingAddress", ""); /* "127.0.0.1" */
static int ListenBacklog = eckit::Resource<int>("socketOptionsListenBacklog", SOMAXCONN);

static bool reusePort = eckit::Resource<bool>("socketOptionsReusePort", false);
static bool reuseAddr = eckit::Resource<bool>("socketOptionsReuseAddr", false);
Expand All @@ -34,6 +31,8 @@ static void init(SocketOptions& opts) {
static int receiveBufferSize = eckit::Resource<int>("socketOptionsReceiveBufferSize", 0);
static int sendBufferSize = eckit::Resource<int>("socketOptionsSendBufferSize", 0);

opts.bindAddress(bindAddr);
opts.listenBacklog(ListenBacklog);
opts.reusePort(reusePort);
opts.reuseAddr(reuseAddr);
opts.noLinger(noLinger);
Expand Down

0 comments on commit 6e50c36

Please sign in to comment.