From ed8883edc475d91d9c4f70111a200a80776a54f5 Mon Sep 17 00:00:00 2001 From: "irvingouj @ Devolutions" Date: Fri, 24 May 2024 13:50:48 -0400 Subject: [PATCH] fix(dotnet): allow caller to use a different port for connection (#469) Updated Devolutions.IronRdp package `Connect` function. Allow user to specify a port other than default 3389. --- ffi/dotnet/Devolutions.IronRdp/src/Connection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs b/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs index 6c2cc099..8f21e535 100644 --- a/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs +++ b/ffi/dotnet/Devolutions.IronRdp/src/Connection.cs @@ -7,10 +7,10 @@ namespace Devolutions.IronRdp; public static class Connection { - public static async Task<(ConnectionResult, Framed)> Connect(Config config, string servername, CliprdrBackendFactory? factory) + public static async Task<(ConnectionResult, Framed)> Connect(Config config, string servername, CliprdrBackendFactory? factory, int port = 3389) { - var stream = await CreateTcpConnection(servername, 3389); + var stream = await CreateTcpConnection(servername, port); var framed = new Framed(stream); ClientConnector connector = ClientConnector.New(config); @@ -21,7 +21,7 @@ public static class Connection throw new IronRdpLibException(IronRdpLibExceptionType.CannotResolveDns, "Cannot resolve DNS to " + servername); } - var socketAddrString = ip[0].ToString() + ":3389"; + var socketAddrString = ip[0].ToString() + ":" + port; connector.WithServerAddr(socketAddrString); if (factory != null)