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

Exception on mono only: System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used #69

Open
jameschch opened this issue Dec 10, 2016 · 5 comments
Labels

Comments

@jameschch
Copy link

I can connect to a wss just fine running in windows, but am getting the following exception only on mono:

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 <bd46d4d4f7964dfa9beea098499ab597>:0 
  at System.Net.Sockets.Socket.ConnectAsync (System.Net.Sockets.SocketType socketType, System.Net.Sockets.ProtocolType protocolType, System.Net.Sockets.SocketAsyncEventArgs e) [0x0000b] in <bd46d4d4f7964dfa9beea098499ab597>: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 <8f2c484307284b51944a1a13a14c0266>: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 <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <8f2c484307284b51944a1a13a14c0266>: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 

I am calling the constructor with one parameter. Have tried latest stable 0.14.1 and also latest beta 0.15 beta6 and get same issue on both. Am running mono 4.6.2 on ubuntu.

@kerryjiang kerryjiang added the bug label Dec 11, 2016
@alexandrecavaco
Copy link

alexandrecavaco commented Feb 9, 2017

Hello, I had the same problem on mono 4.6.2 on Ubuntu 16.04.
I've reverted (temporarily) to mono 4.2.1 and it works fine, the exception is never thrown.
It seems like a Mono issue then, although I don't know if a workaround could be found.

@jaredbroad
Copy link

Mono 5.4 fixes it but Mono 5.4 has memory and threading issues. We're eager for a fix for this too.

@BryanCrotaz
Copy link

BryanCrotaz commented Oct 23, 2017

@alexandrecavaco How did you revert to 4.2.1? I'm trying to get this working on raspberry pi but can't work out the process to downgrade mono (I'm a Windows guy).

@alexandrecavaco
Copy link

Hi @BryanCrotaz. I did that some months ago (I was at another company then), and presently I'm not working with Mono, but I know it involved pinning or holding apt packages on Ubuntu (you can learn what pinning is here.
You can try to follow this stackoverflow answer here, but you probably need to ajust it for Raspberry.

@mariotacke
Copy link

Team and I are running into the same thing right now. We are on Mono 4.8 and cannot upgrade or downgrade. We've tried it with 0.15.x.

Has anyone found a workaround for this?

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

No branches or pull requests

6 participants