Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions gloo/transport/tcp/socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ void Socket::block(bool on) {
GLOO_ENFORCE_NE(rv, -1, "fcntl: ", strerror(errno));
}

void Socket::configureTimeout(int opt, std::chrono::milliseconds timeout) {
struct timeval tv = {
void Socket::configureTimeout(int opt, const std::chrono::milliseconds timeout) {
struct timeval {
long long tv_sec;
long long tv_usec;
} tv = {
.tv_sec = timeout.count() / 1000,
.tv_usec = (timeout.count() % 1000) * 1000,
};
Expand Down
5 changes: 5 additions & 0 deletions gloo/transport/tcp/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

#include <gloo/transport/tcp/address.h>

#ifndef SOCK_NONBLOCK
#include <fcntl.h>
#define SOCK_NONBLOCK O_NONBLOCK
#endif

namespace gloo {
namespace transport {
namespace tcp {
Expand Down