Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for MacOS #376

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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