question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recent disconnects from Discord

See original GitHub issue

Keep getting the following recently and not sure why, what’s the best way to do a reconnect when this happens?

System.Exception: WebSocket connection was closed ---> System.Net.WebSockets.WebSocketException: The remote party closed the WebSocket connection without completing the close handshake. at System.Net.WebSockets.WebSocketBase.WebSocketOperation.<Process>d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.WebSocketBase.<ReceiveAsyncCore>d__45.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Discord.Net.WebSockets.DefaultWebSocketClient.<RunAsync>d__32.MoveNext() --- End of inner exception stack trace --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Jimmy062006commented, Aug 11, 2017

My connection is stable yet loops like this sometimes.

10/08/2017 23:44:29 [ Warning]:
System.Exception: WebSocket connection was closed ---> System.Exception: Unexpected close
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()
10/08/2017 23:44:29 [    Info]: Disconnecting
10/08/2017 23:44:29 [    Info]: Disconnected
10/08/2017 23:44:30 [    Info]: Connecting
10/08/2017 23:44:31 [    Info]: Resumed previous session
10/08/2017 23:44:31 [    Info]: Connected
11/08/2017 00:23:32 [ Warning]:
System.Exception: WebSocket connection was closed ---> System.Exception: Unexpected close
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()
11/08/2017 00:23:32 [    Info]: Disconnecting
11/08/2017 00:23:32 [    Info]: Disconnected
11/08/2017 00:23:33 [    Info]: Connecting
11/08/2017 00:23:35 [    Info]: Resumed previous session
11/08/2017 00:23:35 [    Info]: Connected
11/08/2017 00:50:03 [ Warning]:
System.Exception: WebSocket connection was closed ---> System.Exception: Unexpected close
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Discord.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()
11/08/2017 00:50:03 [    Info]: Disconnecting
11/08/2017 00:50:03 [    Info]: Disconnected
11/08/2017 00:50:04 [    Info]: Connecting
11/08/2017 00:50:05 [    Info]: Resumed previous session
11/08/2017 00:50:05 [    Info]: Connected
0reactions
RheaAyasecommented, Oct 19, 2017

This issue is caused by D.NET being too slow to process tcp messages, causing tcp buffer overflow on the systgem, which drops the connection. Happens on a raw client without any user code, without any signed up events. on just large bot account. I.e. this is definitely not a “fix your code” type of issue.

See #850

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Fixed]: Discord Keeps Disconnecting and Reconnecting
If Discord still keeps disconnecting, try flushing your computer's DNS cache and resetting your IP settings. · To do this, input 'cmd' in...
Read more >
Discord Keeps Disconnecting and Reconnecting? 15 Ways ...
1. Check the Discord Server Status · 2. Check Your Network Connection · 3. Update Discord to Its Latest Version · 4. Force-Quit...
Read more >
Discord Keeps Disconnecting - Here's How To Fix?
The most common cause for the Discord to disconnect is unstable internet connection. Check your connectivity strength using third-party speed checkers. Also, ...
Read more >
How to Fix Discord Keeps Disconnecting and Reconnecting?
This can be due to a number of reasons which include running Discord with insufficient permissions or the server region that you are...
Read more >
Fix: Discord Keeps Disconnecting And Reconnecting [2023]
Fix 1: Check Your Internet Connection ... It might sound a bit redundant as you need internet access to read this article, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found