return true;
}
-bool wxSocketBase::SetLocal(wxSockAddress& local)
+bool wxSocketBase::SetLocal(wxIPV4address& local)
{
GAddress* la = local.GetAddress();
+ // If the address is valid, save it for use when we call Connect
if (la && la->m_addr)
{
- m_socket->SetLocal(la);
+ m_localAddress = local;
return true;
}
m_socket->SetReusable();
}
+ // If no local address was passed and one has been set, use the one that was Set
+ if (!local && m_localAddress.GetAddress())
+ {
+ local = &m_localAddress;
+ }
+
// Bind to the local IP address and port, when provided
if (local)
{