From 4a7aad06d95701cf232198093ce396dcdbb53e5b Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:01:47 +0900 Subject: ZeroMQ renamed to Crossroads Signed-off-by: Martin Sustrik --- src/ip.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/ip.cpp') diff --git a/src/ip.cpp b/src/ip.cpp index 0b4596a..2e7f2db 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -1,16 +1,16 @@ /* - Copyright (c) 2010-2011 250bpm s.r.o. + Copyright (c) 2010-2012 250bpm s.r.o. Copyright (c) 2007-2009 iMatix Corporation Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file - This file is part of 0MQ. + This file is part of Crossroads project. - 0MQ is free software; you can redistribute it and/or modify it under + Crossroads is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - 0MQ is distributed in the hope that it will be useful, + Crossroads is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -23,7 +23,7 @@ #include "err.hpp" #include "platform.hpp" -#if defined ZMQ_HAVE_WINDOWS +#if defined XS_HAVE_WINDOWS #include "windows.hpp" #else #include @@ -33,15 +33,15 @@ #include #endif -#if defined ZMQ_HAVE_OPENVMS +#if defined XS_HAVE_OPENVMS #include #endif -zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_) +xs::fd_t xs::open_socket (int domain_, int type_, int protocol_) { // Setting this option result in sane behaviour when exec() functions // are used. Old sockets are closed and don't block TCP ports etc. -#if defined ZMQ_HAVE_SOCK_CLOEXEC +#if defined XS_HAVE_SOCK_CLOEXEC type_ |= SOCK_CLOEXEC; #endif @@ -52,7 +52,7 @@ zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_) // If there's no SOCK_CLOEXEC, let's try the second best option. Note that // race condition can cause socket not to be closed (if fork happens // between socket creation and this point). -#if !defined ZMQ_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC +#if !defined XS_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC int rc = fcntl (s, F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif @@ -60,21 +60,21 @@ zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_) return s; } -void zmq::tune_tcp_socket (fd_t s_) +void xs::tune_tcp_socket (fd_t s_) { - // Disable Nagle's algorithm. We are doing data batching on 0MQ level, - // so using Nagle wouldn't improve throughput in anyway, but it would - // hurt latency. + // Disable Nagle's algorithm. We are doing data batching on Crossroads + // level, so using Nagle wouldn't improve throughput in anyway, but it + // would hurt latency. int nodelay = 1; int rc = setsockopt (s_, IPPROTO_TCP, TCP_NODELAY, (char*) &nodelay, sizeof (int)); -#ifdef ZMQ_HAVE_WINDOWS +#ifdef XS_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif -#ifdef ZMQ_HAVE_OPENVMS +#ifdef XS_HAVE_OPENVMS // Disable delayed acknowledgements as they hurt latency is serious manner. int nodelack = 1; rc = setsockopt (s_, IPPROTO_TCP, TCP_NODELACK, (char*) &nodelack, @@ -83,13 +83,13 @@ void zmq::tune_tcp_socket (fd_t s_) #endif } -void zmq::unblock_socket (fd_t s_) +void xs::unblock_socket (fd_t s_) { -#ifdef ZMQ_HAVE_WINDOWS +#ifdef XS_HAVE_WINDOWS u_long nonblock = 1; int rc = ioctlsocket (s_, FIONBIO, &nonblock); wsa_assert (rc != SOCKET_ERROR); -#elif ZMQ_HAVE_OPENVMS +#elif XS_HAVE_OPENVMS int nonblock = 1; int rc = ioctl (s_, FIONBIO, &nonblock); errno_assert (rc != -1); @@ -102,17 +102,17 @@ void zmq::unblock_socket (fd_t s_) #endif } -void zmq::enable_ipv4_mapping (fd_t s_) +void xs::enable_ipv4_mapping (fd_t s_) { #ifdef IPV6_V6ONLY -#ifdef ZMQ_HAVE_WINDOWS +#ifdef XS_HAVE_WINDOWS DWORD flag = 0; #else int flag = 0; #endif int rc = setsockopt (s_, IPPROTO_IPV6, IPV6_V6ONLY, (const char*) &flag, sizeof (flag)); -#ifdef ZMQ_HAVE_WINDOWS +#ifdef XS_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); -- cgit v1.2.3