Skip to content
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

For .NET Core, TcpClient doesn't support the .Connect() API #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

3bh
Copy link

@3bh 3bh commented Aug 10, 2018

TcpClient only supports ConnectAsync() in .NET Core. This requires that our .Connect() wrapper wait for the .ConnectAsync() call to complete before calling .GetStream(), so we will make the .Connect() method awaitable.

…nnectAsync(). This requires that our .Connect() wrapper wait for the .ConnectAsync() call to complete before calling .GetStream(), so we will make the .Connect() method awaitable.
@@ -73,13 +74,13 @@ public ModbusClient()
/// <summary>
/// Establish connection to Master device in case of Modbus TCP. Opens COM-Port in case of Modbus RTU
/// </summary>
public void Connect()
public async Task ConnectAsync()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to add CancellationToken support to Async Methods and also to evaluat it as well and do not trust the third party is doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants