internet: add NotifyConnection[Succeeded,Failed] to Ipv[4,6]RawScocket
This commit is contained in:
committed by
Stefano Avallone
parent
eaa62db26f
commit
30bade8812
@@ -178,11 +178,13 @@ Ipv4RawSocketImpl::Connect (const Address &address)
|
||||
if (!InetSocketAddress::IsMatchingType (address))
|
||||
{
|
||||
m_err = Socket::ERROR_INVAL;
|
||||
NotifyConnectionFailed ();
|
||||
return -1;
|
||||
}
|
||||
InetSocketAddress ad = InetSocketAddress::ConvertFrom (address);
|
||||
m_dst = ad.GetIpv4 ();
|
||||
SetIpTos (ad.GetTos ());
|
||||
NotifyConnectionSucceeded ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -184,10 +184,12 @@ int Ipv6RawSocketImpl::Connect (const Address& address)
|
||||
if (!Inet6SocketAddress::IsMatchingType (address))
|
||||
{
|
||||
m_err = Socket::ERROR_INVAL;
|
||||
NotifyConnectionFailed ();
|
||||
return -1;
|
||||
}
|
||||
Inet6SocketAddress ad = Inet6SocketAddress::ConvertFrom (address);
|
||||
m_dst = ad.GetIpv6 ();
|
||||
NotifyConnectionSucceeded ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user