Skip to content

Commit

Permalink
fix(dotnet): allow caller to use a different port for connection (#469)
Browse files Browse the repository at this point in the history
Updated Devolutions.IronRdp package `Connect` function. Allow user to specify a port other than default 3389.
  • Loading branch information
irvingoujAtDevolution authored May 24, 2024
1 parent 5266147 commit ed8883e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ffi/dotnet/Devolutions.IronRdp/src/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ namespace Devolutions.IronRdp;
public static class Connection
{

public static async Task<(ConnectionResult, Framed<SslStream>)> Connect(Config config, string servername, CliprdrBackendFactory? factory)
public static async Task<(ConnectionResult, Framed<SslStream>)> 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<NetworkStream>(stream);

ClientConnector connector = ClientConnector.New(config);
Expand All @@ -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)
Expand Down

0 comments on commit ed8883e

Please sign in to comment.