Add support for HyperV socket connection

This commit add support for connection over HyperV socket (hvsock) which are
used in scenario like WSLg on Windows. hvsock requires accept and close
to monitor in addition to read. Also mark hvsock connection as local.
This commit is contained in:
Steve Pronovost 2021-10-16 09:46:55 -07:00 committed by akallabeth
parent 592f8d95be
commit dba2a7e4a6

View File

@ -230,12 +230,13 @@ static BOOL freerdp_listener_open_from_socket(freerdp_listener* instance, int fd
return FALSE;
listener->sockfds[listener->num_sockfds] = fd;
listener->events[listener->num_sockfds] =
CreateFileDescriptorEvent(NULL, FALSE, FALSE, fd, WINPR_FD_READ);
listener->events[listener->num_sockfds] = WSACreateEvent();
if (!listener->events[listener->num_sockfds])
return FALSE;
WSAEventSelect(fd, listener->events[listener->num_sockfds], FD_READ | FD_ACCEPT | FD_CLOSE);
listener->num_sockfds++;
WLog_INFO(TAG, "Listening on socket %d.", fd);
return TRUE;
@ -320,7 +321,7 @@ BOOL freerdp_peer_set_local_and_hostname(freerdp_peer* client,
}
#ifndef _WIN32
else if (peer_addr->ss_family == AF_UNIX)
else if (peer_addr->ss_family == AF_UNIX || peer_addr->ss_family == AF_VSOCK)
client->local = TRUE;
#endif