ForceUniverse/dart-force — pull request #19 by platelk (2014-11-02 03:08:27+00:00)
Title: Issue#18 : Create a 'server_client' to allow 2 server talk each other

It's a simple implementation of a "ForceClient" for the server side.

This allow this kind of code:

int main() {

ForceClient fc = new ForceClient(host: "127.0.0.1", port: "9223");
ForceServer fs = new ForceServer( port: 9223);

fs.start().then((e) {
fc.connect();
fc.onConnected.listen((e) {
fs.on("test", (e, sendable) {
print("Receive from server: ${e.json}");
sendable.send('test', e.json);
fs.close("Stop");
});
fc.on("test", (e, sender) {
print("Receive from client: ${e.json}");
});
fc.send('test', "Trololo");
});
fc.onDisconnected.listen((e) {
print("Deco: ${e}");
});
});
}