Skip to content

Commit

Permalink
Implement ntsu::SocketOptionUtil::setZeroCopy on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrm456 committed Feb 5, 2024
1 parent c94325d commit 1ae83a0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions groups/nts/ntscfg/ntscfg_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <bsls_ident.h>
BSLS_IDENT_RCSID(ntscfg_platform_cpp, "$Id$ $CSID$")

#include <bslmt_once.h>
#include <bdls_filesystemutil.h>
#include <bsls_log.h>
#include <bsls_platform.h>
Expand Down
19 changes: 19 additions & 0 deletions groups/nts/ntsu/ntsu_socketoptionutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,14 @@ ntsa::Error SocketOptionUtil::setTimestampOutgoingData(
return ntsa::Error(ntsa::Error::e_NOT_IMPLEMENTED);
}

ntsa::Error SocketOptionUtil::setZeroCopy(ntsa::Handle socket, bool zeroCopy)
{
NTSCFG_WARNING_UNUSED(socket);
NTSCFG_WARNING_UNUSED(zeroCopy);

return ntsa::Error(ntsa::Error::e_NOT_IMPLEMENTED);
}

ntsa::Error SocketOptionUtil::setLinger(ntsa::Handle socket,
bool linger,
const bsls::TimeInterval& duration)
Expand Down Expand Up @@ -2550,6 +2558,17 @@ ntsa::Error SocketOptionUtil::getTimestampOutgoingData(bool* timestampFlag,
return ntsa::Error(ntsa::Error::e_NOT_IMPLEMENTED);
}

ntsa::Error SocketOptionUtil::getZeroCopy(bool* zeroCopyFlag,
ntsa::Handle socket)
{
NTSCFG_WARNING_UNUSED(zeroCopyFlag);
NTSCFG_WARNING_UNUSED(socket);

*zeroCopyFlag = false;

return ntsa::Error(ntsa::Error::e_NOT_IMPLEMENTED);
}

ntsa::Error SocketOptionUtil::getSendBufferRemaining(bsl::size_t* size,
ntsa::Handle socket)
{
Expand Down
12 changes: 12 additions & 0 deletions groups/nts/ntsu/ntsu_socketutil.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7604,77 +7604,89 @@ NTSCFG_TEST_CASE(19)
// Concern: Datagram socket transmission with control data: single buffer.
// Plan:

#if defined(BSLS_PLATFORM_UNIX)
ntscfg::TestAllocator ta;
{
test::executeDatagramSocketTest(
&test::testDatagramSocketTransmissionSingleBufferWithControlMsg);
}
NTSCFG_TEST_ASSERT(ta.numBlocksInUse() == 0);
#endif
}

NTSCFG_TEST_CASE(20)
{
// Concern: Datagram socket transmission with control data: blob.
// Plan:

#if defined(BSLS_PLATFORM_UNIX)
ntscfg::TestAllocator ta;
{
test::executeDatagramSocketTest(
&test::testDatagramSocketTransmissionBlobWithControlMsg);
}
NTSCFG_TEST_ASSERT(ta.numBlocksInUse() == 0);
#endif
}

NTSCFG_TEST_CASE(21)
{
// Concern: Datagram socket transmission with control data: dropped.
// Plan:

#if defined(BSLS_PLATFORM_UNIX)
ntscfg::TestAllocator ta;
{
test::executeDatagramSocketTest(
&test::testDatagramSocketTransmissionWithControlMsgDropped);
}
NTSCFG_TEST_ASSERT(ta.numBlocksInUse() == 0);
#endif
}

NTSCFG_TEST_CASE(22)
{
// Concern: Stream socket transmission with control data: single buffer.
// Plan:

#if defined(BSLS_PLATFORM_UNIX)
ntscfg::TestAllocator ta;
{
test::executeStreamSocketTest(
&test::testStreamSocketTransmissionSingleBufferWithControlMsg);
}
NTSCFG_TEST_ASSERT(ta.numBlocksInUse() == 0);
#endif
}

NTSCFG_TEST_CASE(23)
{
// Concern: Stream socket transmission with control data: blob.
// Plan:

#if defined(BSLS_PLATFORM_UNIX)
ntscfg::TestAllocator ta;
{
test::executeStreamSocketTest(
&test::testStreamSocketTransmissionBlobWithControlMsg);
}
NTSCFG_TEST_ASSERT(ta.numBlocksInUse() == 0);
#endif
}

NTSCFG_TEST_CASE(24)
{
// Concern: Stream socket transmission with control data: dropped
// Plan:

#if defined(BSLS_PLATFORM_UNIX)
ntscfg::TestAllocator ta;
{
test::executeStreamSocketTest(
&test::testStreamSocketTransmissionWithControlMsgDropped);
}
NTSCFG_TEST_ASSERT(ta.numBlocksInUse() == 0);
#endif
}

NTSCFG_TEST_CASE(25)
Expand Down
4 changes: 2 additions & 2 deletions repository.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,8 @@ function (ntf_target_options_common_prolog target)
# problem of different translation units compiled with different
# settings of /MD and /MDd.

ntf_target_build_option(
TARGET ${target} LINK VALUE /FORCE)
# ntf_target_build_option(
# TARGET ${target} LINK VALUE /FORCE)
endif()

endfunction()
Expand Down

0 comments on commit 1ae83a0

Please sign in to comment.