Skip to content

Commit

Permalink
conditionally compile the new ChannelSocket constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jmillan committed Feb 24, 2025
1 parent 1e5c3f1 commit a8b48db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion worker/include/Channel/ChannelSocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ namespace Channel
};

public:
// For testing purposes only.
#ifdef MS_TEST
explicit ChannelSocket();
#endif
explicit ChannelSocket(int consumerFd, int producerFd);
explicit ChannelSocket(
ChannelReadFn channelReadFn,
Expand Down
6 changes: 2 additions & 4 deletions worker/src/Channel/ChannelSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ namespace Channel

/* Instance methods. */

#ifdef MS_TEST
ChannelSocket::ChannelSocket()
{
MS_TRACE_STD();
}
#endif

ChannelSocket::ChannelSocket(int consumerFd, int producerFd)
: consumerSocket(new ConsumerSocket(consumerFd, MessageMaxLen, this)),
Expand Down Expand Up @@ -265,10 +267,6 @@ namespace Channel
{
this->producerSocket->Write(payload, payloadLen);
}
else
{
MS_DEBUG_DEV("sending Channel message: %s", payload);
}
}

void ChannelSocket::OnConsumerSocketMessage(
Expand Down

0 comments on commit a8b48db

Please sign in to comment.