Fixes #2982. The idea is to be able to create the socket externally and pass that socket FD to FreeRDP so that it can be used there.

The idea suggested is to use the following interface:

settings->ServerHostname = "|"
settings->ServerPort = SocketFD
This commit is contained in:
Nito Martinez
2015-11-20 02:44:35 +01:00
parent be8f8f7238
commit 428cbd802d

View File

@@ -1047,6 +1047,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
UINT32 optval;
socklen_t optlen;
BOOL ipcSocket = FALSE;
BOOL useExternalDefinedSocket = FALSE;
if (!hostname)
return -1;
@@ -1054,12 +1055,18 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
if (hostname[0] == '/')
ipcSocket = TRUE;
if (hostname[0] == '|')
useExternalDefinedSocket = TRUE;
if (ipcSocket)
{
sockfd = freerdp_uds_connect(hostname);
if (sockfd < 0)
return -1;
} else if (useExternalDefinedSocket)
{
sockfd = port;
}
else
{