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

ConnectAsync with CancellationToken hangs #137

Open
vbisbest opened this issue Jul 29, 2017 · 1 comment
Open

ConnectAsync with CancellationToken hangs #137

vbisbest opened this issue Jul 29, 2017 · 1 comment

Comments

@vbisbest
Copy link

On iOS, it appears that using a cancellationtoken locks up the app and just hangs when the socket is really waiting to timeout. Here is the code:

` socket = new TcpSocketClient();

            cts = new CancellationTokenSource();
            cts.CancelAfter(10000);
            
            task = socket.ConnectAsync(serverInfoState.Server.RealIP, serverInfoState.Server.RealPort, false, cts.Token);
           await task;`

Am I using the token incorrectly? Connecting to a server that I know is unavailable causes the behavior. In the above code, the app remains responsive for 10 seconds, the it locks up for about another 30 seconds and eventually throws the cancellation error.

@sushibear
Copy link

sushibear commented Jul 12, 2018

Same on UWP it seems..

Any code after using ConnectAsync is not beeing called. It hangs and does not throw any error or warning for me.

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

No branches or pull requests

2 participants