This project is read-only.

How to use WebSocket4Net in Xamarin.Android

May 19, 2014 at 4:54 PM
I'm trying to add reference in Visual Studio via NuGet, but I get an error that there are no references in file of solution to connect to files in Xamarin.
Help me, please, I see that WebSocket4Net is useful with Xamarin.Android, but I dont' know how and there are no examples.
May 19, 2014 at 5:03 PM
Can you reference it manually? I think NuGet doesn't support Xamarin for now.

The homepage of the project has the demo code.
May 20, 2014 at 8:14 AM
Thanks for your answer.

Manually....I tried to add sub-project WebSocket4Net.MonoDroid to my solusion and to make some changes in WebSocket4Net.MonoDroid.WebSocket class (change m_UriPrefix from "ws://" to "http://"), but when I began to debug program worked like I didn't make any changes. How can I make changes working?
May 20, 2014 at 8:40 AM
ws:// to http://??

Why did you want to do that?

It's completely wrong!
May 20, 2014 at 8:53 AM
Because I'd like to make socket connecting to address beginning on "http://".

What I should to make it works correctly?
May 20, 2014 at 11:14 AM
WebSocket4Net is designed to connect a websocket service instead of a http service.
May 20, 2014 at 2:07 PM
Ok, thanks. I'm novice for sockets that's why I thought wrong.
Aug 1, 2014 at 9:41 PM
It is possible that the latest version of the WebSocket4Net do not work correctly with "wss://" on Android?
I can connect fine with http, https and ws but not with wss. wss does work on regular .net (Windows Application) using WebSockets4Net.

On Android, I never get a "websocket.opened" event.

Also, your websocket.Error event is the only event that uses "SuperSocket" EventArgs (ErrorEventArgs). This cannot be used unless the SuperSocket.ClientEngine.Core.Dll is added to the project - just because of the ErrorEventArgs:( Is there a possibility for a different EventArgs class to be used in your code?

Aug 1, 2014 at 10:57 PM
I just found out that this might have two reasons:

1) It looks like mono, MonoDroid and MonoTouch have their own certificate store and require me to put the root certificate (in my case "Starfield") in.
2) Mono is not parsing the "Alternate Subject Names" in the certificate to validate it.

Can you confirm this?