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

Add Missing Parameter For WebSocket4Net Constructor #968

Merged
merged 2 commits into from
Mar 4, 2018
Merged

Add Missing Parameter For WebSocket4Net Constructor #968

merged 2 commits into from
Mar 4, 2018

Conversation

Headline
Copy link
Contributor

@Headline Headline commented Mar 1, 2018

Due to changes with WebSocket4Net, new-ish versions need another parameter for the constructor in order to avoid the MissingMethodException. This Fixes that issue.

System.MissingMethodException: Method not found: 'Void WebSocket4Net.WebSocket..ctor(System.String, System.String, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.String, System.String, WebSocket4Net.WebSocketVersion, System.Net.EndPoint)'.
   at Discord.Net.Providers.WS4Net.WS4NetClient.<ConnectInternalAsync>d__21.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Discord.Net.Providers.WS4Net.WS4NetClient.ConnectInternalAsync(String host)
   at Discord.Net.Providers.WS4Net.WS4NetClient.<ConnectAsync>d__20.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.API.DiscordSocketApiClient.<ConnectInternalAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Discord.API.DiscordSocketApiClient.<ConnectInternalAsync>d__25.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.API.DiscordSocketApiClient.<ConnectAsync>d__24.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.WebSocket.DiscordSocketClient.<OnConnectingAsync>d__93.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Discord.WebSocket.DiscordSocketClient.<OnConnectingAsync>d__93.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.ConnectionManager.<ConnectAsync>d__30.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.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()
15:11:43 Gateway     Disconnecting
15:11:43 Gateway     Disconnected
15:11:43 SteamCB     Steam connected!
15:11:44 Gateway     Connecting
15:11:44 Rest        GET gateway: 42.37 ms
15:11:44 Gateway     System.MissingMethodException: Method not found: 'Void WebSocket4Net.WebSocket..ctor(System.String, System.String, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.String, System.String, WebSocket4Net.WebSocketVersion, System.Net.EndPoint)'.
   at Discord.Net.Providers.WS4Net.WS4NetClient.<ConnectInternalAsync>d__21.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at Discord.Net.Providers.WS4Net.WS4NetClient.ConnectInternalAsync(String host)
   at Discord.Net.Providers.WS4Net.WS4NetClient.<ConnectAsync>d__20.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.API.DiscordSocketApiClient.<ConnectInternalAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Discord.API.DiscordSocketApiClient.<ConnectInternalAsync>d__25.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.API.DiscordSocketApiClient.<ConnectAsync>d__24.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.WebSocket.DiscordSocketClient.<OnConnectingAsync>d__93.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Discord.WebSocket.DiscordSocketClient.<OnConnectingAsync>d__93.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.ConnectionManager.<ConnectAsync>d__30.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.ConnectionManager.<>c__DisplayClass28_0.<<StartAsync>b__0>d.MoveNext()

This should fix `15:02:44 Gateway     System.MissingMethodException: Method not found: 'Void WebSocket4Net.WebSocket..ctor(System.String, System.String, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.String, System.String, WebSocket4Net.WebSocketVersion, System.Net.EndPoint)'.`
@FiniteReality
Copy link
Member

I'm fairly sure we don't need the WS4Net stuff any more, because if I remember correctly, somebody mentioned that the underlying issues which made it necessary have been resolved.

@foxbot
Copy link
Member

foxbot commented Mar 1, 2018

If we're going to update anything regarding WS4Net, may as well bump the package up to the latest version, no?

@Headline
Copy link
Contributor Author

Headline commented Mar 1, 2018

@FiniteReality It's still very useful for supporting older windows systems. See Headline/Discord-IRC-Relay#8
@foxbot Yes, this will be done soon. You suggest an entire bump to 2.0.0-beta3?

@foxbot foxbot merged commit 8537924 into discord-net:dev Mar 4, 2018
@Headline Headline deleted the patch-1 branch March 4, 2018 20:04
FiniteReality pushed a commit to FiniteReality/Discord.Net that referenced this pull request May 5, 2018
* Add missing param to constructor

This should fix `15:02:44 Gateway     System.MissingMethodException: Method not found: 'Void WebSocket4Net.WebSocket..ctor(System.String, System.String, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.Collections.Generic.List`1<System.Collections.Generic.KeyValuePair`2<System.String,System.String>>, System.String, System.String, WebSocket4Net.WebSocketVersion, System.Net.EndPoint)'.`

* Bump WS4N to latest stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants