-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
overload.
#43111
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/ncl |
We would certainly also want the newer ValueTask-CancellationToken overload. I assume the reason that overload was missed is because the non-cancellable overload was missing. public ValueTask ConnectAsync(IPEndPoint remoteEP, CancellationToken cancellationToken); |
Proposal updated in top post and marked as ready for review -- cc @scalablecory |
I vaguely recall that we decided to leave this one off intentionally, but I could be misremembering. |
This just seems like an oversight. We have a sync overload for this, but not async. |
namespace System.Net.Sockets
{
public class TcpClient : IDisposable
{
//public void Connect(IPAddress address, int port);
//public void Connect(IPAddress[] ipAddresses, int port);
//public Task Connect(IPEndPoint remoteEP);
//public void Connect(string hostname, int port);
//public Task ConnectAsync(IPAddress address, int port);
//public Task ConnectAsync(IPAddress[] addresses, int port);
//public Task ConnectAsync(string host, int port);
public Task ConnectAsync(IPEndPoint remoteEP);
//public ValueTask ConnectAsync(IPAddress address, int port, CancellationToken cancellationToken);
//public ValueTask ConnectAsync(IPAddress[] addresses, int port, CancellationToken cancellationToken);
//public ValueTask ConnectAsync(string host, int port, CancellationToken cancellationToken);
public ValueTask ConnectAsync(IPEndPoint remoteEP, CancellationToken cancellationToken);
}
} |
@MartyIX are you interested in submitting a PR? |
@karelz I would kind of love to try but I don't have too much time lately on hand. So I would let it up-for-grabs. |
Background and Motivation
This issue proposes to add
System.Net.Sockets.TcpClient.ConnectAsync(IPEndPoint remoteEP)
method.This issue was filed based on #40750 and comment #40750 (comment) by @geoffkizer.
Proposed API
Usage Examples
Usage example is the same as for
System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
.Alternative Designs
N/A.
Risks
N/A
The text was updated successfully, but these errors were encountered: