NVentimiglia / WebSocket.Portable

C# Portable WebSocket Client Library (Rfc 6455). Works with Xamarin.
Apache License 2.0
11 stars 2 forks source link

DEPRECATED

Please use Websockets.Pcl, a much improved version.

WebSocket.Portable

WebSocket.Portable is a PCL Profile 259 C# implementation of the WebSocket protocol. This plugin uses .net 4.5 and is compatible with Windows 8, Windows Phone, Windows Phone Silverlight, Xamarin Android, Xamarin iOS, and Xamarin iOS (Classic). This is a fork from esskar.

NuGet

https://www.nuget.org/packages/WebSocket.Portable.Core/

Modifications

Dependencies

Important : These must be installed on all platforms. So if you have a XamarinApp.Common and a XamarinApp.Droid, both projects needs the above dependencies.

Usage

var client = new WebSocketClient();

// get notified when data has arrived
client.FrameReceived += frame => Console.WriteLine(frame);

// open a web socket connection to ws://echo.websocket.org
await client.OpenAsync("ws://echo.websocket.org");

// send some data
await client.SendAsync("WebSocket.Portable rocks!");

Example

There is a XamarinApp.Droid example located in the /Examples/ folder.

TODO

Thanks

Questions

Post onto the Github issue system or contact me via my blog