From 9f4698526ade9864aab6253466dbdf461321e2cb Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 4 Oct 2017 12:16:07 -0400 Subject: [PATCH] Fix idents issues from #105 --- apps/stransmit.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/stransmit.cpp b/apps/stransmit.cpp index 955c7361f..f495c4de6 100644 --- a/apps/stransmit.cpp +++ b/apps/stransmit.cpp @@ -1299,7 +1299,7 @@ class UdpCommon if ( adapter == "" ) { maddr.sin_addr.s_addr = htonl(INADDR_ANY); - maddr.sin_port = htons(port); // necessary for temporary use + maddr.sin_port = htons(port); // necessary for temporary use } else { @@ -1318,20 +1318,20 @@ class UdpCommon #endif #if defined(WIN32) || defined(__CYGWIN__) - // On Windows it somehow doesn't work when bind() - // is called with multicast address. Write the address - // that designates the network device here. - // Also, sets port sharing when working with multicast - sadr = maddr; - int reuse = 1; - int shareAddrRes = setsockopt(m_sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&reuse), sizeof(reuse)); - if (shareAddrRes == status_error) - { - throw runtime_error("marking socket for shared use failed"); - } + // On Windows it somehow doesn't work when bind() + // is called with multicast address. Write the address + // that designates the network device here. + // Also, sets port sharing when working with multicast + sadr = maddr; + int reuse = 1; + int shareAddrRes = setsockopt(m_sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&reuse), sizeof(reuse)); + if (shareAddrRes == status_error) + { + throw runtime_error("marking socket for shared use failed"); + } #endif - int res = setsockopt(m_sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, mreq_arg, sizeof(mreq)); + int res = setsockopt(m_sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, mreq_arg, sizeof(mreq)); if ( res == status_error ) {