Open coding-chick opened 10 years ago
Even though this library is platform dependent, PCL support should be possible using the Bait and Switch PCL trick (details at http://log.paulbetts.org/the-bait-and-switch-pcl-trick/). At least that's my understanding. I don't have access to Visual Studio, which would be the easiest way I know of generating the necessary abstract classes.
And all that said, my understanding of how to implement this is VERY shallow. I may not be correct on any of it.
Yes, please!
Is there anyone can join me to do this job? I am working on many different open source projects, so I don't have enough time for all the tasks. It should be difficult because you don't have System.Net.Sockets.Socket class in some runtimes like WinRT and WP8.1+.
No, but in Win8.1/WP8.1 there is native MessageWebSocket
class (client-side WebSocket) that can be wrapped with your library.
Probably it is good idea to encapsulate MessageWebSocket in WebSocket4Net(WinRT) to keep the consistent API for all the platform. But it cannot be a PCL library then.
@kerryjiang Why not? It can through the Bait-and-Switch trick mentioned above. There is another one good explanation on it here: http://www.guruumeditation.net/bait-and-switch-pcl-explained
@RReverser Nice trick, it seems I should have a try.
@kerryjiang :+1: Just please note that MessageWebSocket
-based part should be marked not just for WinRT (Windows 8.1) but also for Windows Phone 8.1 so it could be used in Universal Apps.
Or you can take a look at https://github.com/DDReaper/Piranha, that'll create a PCL based on a couple of platform dependent dll files.
Oh, it seems only a trick of NuGet? I mean Bait and Switch PCL trick.
Do you have any updates? i'd like to make PCL w/ web sockets for xamarin and windows 8.1, but installing WebSocket4Net I get an error that don't have package for Profile=111:
"Could not install package 'WebSocket4Net 0.13.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111' "
@kerryjiang Yes.
Is it possible to add a PCL support for WebSockets? Or is it platform dependent?