-
Notifications
You must be signed in to change notification settings - Fork 41
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
Make socket available in clients #30
Make socket available in clients #30
Conversation
This will allow message encoding/decoding to be shared.
They can now also be created from a name and data.
@lvivski thoughts? |
Can you please update the |
For sure. I will update the example and the README. I am probably going to add some more tests to but thought I would give you a chance to give some feedback. One question, do you think adding an optional data parameter to Socket#send makes sense? It should keep the method signature compatible with what's there now but would be more concise than sending socket.send(new Message("test", data: 123)). |
Yes, sendind with |
I need to expose a Socket based on dart:html to browsers.
@lvivski this is still a work in progress but I hit a snag when I discovered that dart:io and dart:html have incompatible implementations of WebSocket. I'm refactoring to accomodate but it's going to take a little longer than I hoped. Will continue to update this PR. |
For your reference, here's the bug associated with this issue: |
So I think we'll have to use separate libraries for back-endt and front-end, but it would be great to have one interface for them |
I have started as you suggest and created an abstract socket class with
|
Ok, I would like to help, but really busy right now :( |
No worries. I'll continue to hack away on this. |
These also come with corresponding tests.
Previously, tests linked in to the /lib folder, exposing some functions not available to real clients. I would like to re-factor all the test methods associated with Message into the Socket tests so that Message does not need to be exposed.
…n-clients Conflicts: test/start_test.dart
I have further work completed on this. Just need to complete testing the Socket#on method in the browser. |
I've added browser implementation and changes both to use Streams. I didn't see any new commits in your fork, so I've merged this changes |
Wow. Nice! Will check out when I am back at a computer!
|
I don't know why it's just closed, it's merged actually, but I did a manual merge. PS: oh, it's the new Github layout, it says |
A first pass at making Socket and Message available to the client. This will streamline the creation of client/server WebSocket apps.
I've written it so the use of Message in the client is optional but supported. I'd really like feedback on the API if you've got some.
This also starts adding tests to socket.