Skip to content

Commit

Permalink
Fix idents issues from #105
Browse files Browse the repository at this point in the history
  • Loading branch information
rndi committed Oct 4, 2017
1 parent 9c464d0 commit 9f46985
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions apps/stransmit.cpp
Expand Up @@ -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
{
Expand All @@ -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<const char*>(&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<const char*>(&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 )
{
Expand Down

0 comments on commit 9f46985

Please sign in to comment.