Bug 1607 - OnOff Application over TCP with IPv6 (fixed bulk-send too)

This commit is contained in:
Tommaso Pecorella
2013-03-23 18:58:03 +01:00
parent a54c1bac4c
commit 0d14fd57b6
2 changed files with 17 additions and 2 deletions

View File

@@ -126,7 +126,15 @@ void BulkSendApplication::StartApplication (void) // Called at time specified by
"In other words, use TCP instead of UDP.");
}
m_socket->Bind ();
if (Inet6SocketAddress::IsMatchingType (m_peer))
{
m_socket->Bind6 ();
}
else if (InetSocketAddress::IsMatchingType (m_peer))
{
m_socket->Bind ();
}
m_socket->Connect (m_peer);
m_socket->ShutdownRecv ();
m_socket->SetConnectCallback (

View File

@@ -148,7 +148,14 @@ void OnOffApplication::StartApplication () // Called at time specified by Start
if (!m_socket)
{
m_socket = Socket::CreateSocket (GetNode (), m_tid);
m_socket->Bind ();
if (Inet6SocketAddress::IsMatchingType (m_peer))
{
m_socket->Bind6 ();
}
else if (InetSocketAddress::IsMatchingType (m_peer))
{
m_socket->Bind ();
}
m_socket->Connect (m_peer);
m_socket->SetAllowBroadcast (true);
m_socket->ShutdownRecv ();