Discord.net 0.9.5 + Mono - An address incompatible with the requested protocol was used
See original GitHub issueThe bot works very well on my Windows machine, but when I tried to migrate it to a Linux server, it built fine, but when I start it, I get the following exception:
Log 10/2/2016 7:19:48 PM: GET voice/regions: 401.86 ms
Log 10/2/2016 7:19:48 PM: GET gateway: 22.95 ms
Log 10/2/2016 7:19:48 PM: Login successful, gateway: wss://gateway.discord.gg/?encoding=json&v=4
Crashed with exception, restarting.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used
at System.Net.Sockets.Socket..ctor (System.Net.Sockets.AddressFamily addressFamily, System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType) [0x0005d] in <6c7c03f48a9747c8a644da4f63a34480>:0
at System.Net.Sockets.Socket.ConnectAsync (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.SocketAsyncEventArgs e) [0x0000b] in <6c7c03f48a9747c8a644da4f63a34480>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00053] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at SuperSocket.ClientEngine.ConnectAsyncExtension.ConnectAsync (System.Net.EndPoint remoteEndPoint, SuperSocket.ClientEngine.ConnectedCallback callback, System.Object state) [0x00039] in <4ba236fbf29248a4985a92e6e3907e4a>:0
at SuperSocket.ClientEngine.TcpClientSession.Connect () [0x00074] in <4ba236fbf29248a4985a92e6e3907e4a>:0
at WebSocket4Net.WebSocket.Open () [0x0003a] in <4ba236fbf29248a4985a92e6e3907e4a>:0
at Discord.Net.WebSockets.WS4NetEngine.Connect (System.String host, System.Threading.CancellationToken cancelToken) [0x000cc] in <599fbedd978e4fce934746a63a740a87>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Discord.Net.WebSockets.WebSocket+<BeginConnect>d__34.MoveNext () [0x003b7] in <599fbedd978e4fce934746a63a740a87>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Discord.Net.WebSockets.GatewaySocket+<Connect>d__12.MoveNext () [0x0013f] in <599fbedd978e4fce934746a63a740a87>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Discord.DiscordClient+<BeginConnect>d__78.MoveNext () [0x00351] in <599fbedd978e4fce934746a63a740a87>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Discord.DiscordClient+<BeginConnect>d__78.MoveNext () [0x005a6] in <599fbedd978e4fce934746a63a740a87>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Discord.DiscordClient+<Connect>d__77.MoveNext () [0x0008b] in <599fbedd978e4fce934746a63a740a87>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at PlaneSculptorsDiscordBot.Program+<Main>c__AnonStorey7+<Main>c__async6.MoveNext () [0x00085] in <a353675f20fb49b8b7b05a5467a7fc40>:0
You can find source code of the bot here: https://github.com/mzabsky/webdrafter/tree/master/bot/PlaneSculptorsDiscordBot
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
c# - SocketException: address incompatible with requested ...
I was trying to run a .Net socket server code on Win7-64bit machine . I keep getting the following error: System.Net.Sockets.SocketException: An ...
Read more >An address incompatible with the requested protocol was ...
I googled about this issue An address incompatible with the requested protocol was used and found out that, this issue is due to...
Read more >Running my own Discord.Net bot
Net package using nuGet in visual studio in my project as my interface with the discord API. Discord.Net is compatible with .
Read more >[Help] Connection Error: An address incompatible with the ...
Every torrent I try to download are displaying the status: "Finding peers 0.0%" and won't start downloading. They have plenty of seeders, ...
Read more >June 2017 - s390x - Fedora Mailing-Lists
... requires mono(dbus-sharp) = 0:1.0.0.0 ... upstream version Package: python-ly-0.9.5-2.fc26 Old package: python-ly-0.9.5-1.fc26 Summary: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Exactly the same problem. Imported certs and using 4.6.1 mono.
Update: The problem seems to be mono itself. Downgrading from 4.6.1 to 4.4.2 fixes the issue instantly. If anyone is having this issue, looks like the temporary workaround is to just downgrade mono.
Stale issue, closing