Skip to content

Commit 0f34490

Browse files
authored
SO_REUSEPORT is not always defined. The build fails on centos-5 (#351)
(manylinux1) which is used to build python wheel. This manylinux1 is ported to cento6, keep is option.
1 parent 441a66b commit 0f34490

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builtins/SocketStreamer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,11 @@ void SocketStreamer::configureSocketServer( )
235235
// One can set socket option using setsockopt function. See manual page
236236
// for details. We are making it 'reusable'.
237237
int on = 1;
238+
239+
#ifdef SO_REUSEADDR
238240
if(0 > setsockopt(sockfd_, SOL_SOCKET, SO_REUSEPORT, (const char *)&on, sizeof(on)))
239241
LOG(moose::warning, "Warn: setsockopt() failed");
242+
#endif
240243

241244
if(0 > setsockopt(sockfd_, SOL_SOCKET, SO_REUSEADDR, (const char *)&on, sizeof(on)))
242245
LOG(moose::warning, "Warn: setsockopt() failed");
@@ -328,7 +331,7 @@ bool SocketStreamer::streamData( )
328331
buffer_ = buffer_.erase(0, sent);
329332

330333
assert( sent == (int)frameSize_);
331-
LOG(moose::debug, "Sent " << sent << " bytes." );
334+
LOG(moose::debug, "Sent " << sent << " bytes." );
332335

333336
if(0 > sent)
334337
{

0 commit comments

Comments
 (0)