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

PCL support #14

Open
coding-chick opened this issue Jul 11, 2014 · 12 comments
Open

PCL support #14

coding-chick opened this issue Jul 11, 2014 · 12 comments

Comments

@coding-chick
Copy link

Is it possible to add a PCL support for WebSockets? Or is it platform dependent?

@EdHubbell
Copy link

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.

@RReverser
Copy link

Yes, please!

@kerryjiang
Copy link
Owner

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+.

@RReverser
Copy link

No, but in Win8.1/WP8.1 there is native MessageWebSocket class (client-side WebSocket) that can be wrapped with your library.

@kerryjiang
Copy link
Owner

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.

@RReverser
Copy link

@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

@kerryjiang
Copy link
Owner

@RReverser Nice trick, it seems I should have a try.

@RReverser
Copy link

@kerryjiang 👍 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.

@yufeih
Copy link

yufeih commented Jan 15, 2015

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.

@kerryjiang
Copy link
Owner

Oh, it seems only a trick of NuGet? I mean Bait and Switch PCL trick.

@deus42
Copy link

deus42 commented Sep 3, 2015

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' "

@RReverser
Copy link

@kerryjiang Yes.

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

No branches or pull requests

6 participants