-
-
Notifications
You must be signed in to change notification settings - Fork 978
Expand file tree
/
Copy pathDirectConnector.cs
More file actions
24 lines (21 loc) · 832 Bytes
/
DirectConnector.cs
File metadata and controls
24 lines (21 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace Renci.SshNet.Connection
{
internal sealed class DirectConnector : ConnectorBase
{
public DirectConnector(IServiceFactory serviceFactory, ISocketFactory socketFactory)
: base(serviceFactory, socketFactory)
{
}
public override Socket Connect(IConnectionInfo connectionInfo)
{
return SocketConnect(new DnsEndPoint(connectionInfo.Host, connectionInfo.Port), connectionInfo.Timeout);
}
public override System.Threading.Tasks.Task<Socket> ConnectAsync(IConnectionInfo connectionInfo, CancellationToken cancellationToken)
{
return SocketConnectAsync(new DnsEndPoint(connectionInfo.Host, connectionInfo.Port), cancellationToken);
}
}
}