udp: set is_connected flag on our socket once connected.
Change-Id: Ie5fcc5152af813d74d33c20ed7c3e81f9e828518 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2548 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
0424248dcb
commit
a03ed4fa08
@ -384,7 +384,10 @@ UdpDomainSupport::ConnectEndpoint(UdpEndpoint *endpoint,
|
||||
|
||||
// we need to activate no matter whether or not we have just disconnected,
|
||||
// as calling connect() always triggers an implicit bind():
|
||||
return _BindEndpoint(endpoint, *endpoint->LocalAddress());
|
||||
status_t status = _BindEndpoint(endpoint, *endpoint->LocalAddress());
|
||||
if (status == B_OK)
|
||||
gSocketModule->set_connected(endpoint->Socket());
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
@ -829,6 +829,11 @@ socket_connected(net_socket* _socket)
|
||||
|
||||
TRACE("socket_connected(%p)\n", socket);
|
||||
|
||||
if (socket->parent == NULL) {
|
||||
socket->is_connected = true;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
BReference<net_socket_private> parent = socket->parent.GetReference();
|
||||
if (parent.Get() == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
Loading…
Reference in New Issue
Block a user