Created
June 22, 2014 17:31
-
-
Save TrainerGuy22/e1514be50db88d7ae914 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "dart:async"; | |
| import "dart:io"; | |
| import "./core.dart"; | |
| import "../../dartboard.dart"; | |
| _handle_client(Socket socket) { | |
| } | |
| bool _client_status = true; | |
| _client_future() { | |
| while(_client_status) {} | |
| } | |
| Future client_start() { | |
| List<Future<Socket>> sockets = new List<Future<Socket>>(); | |
| for(User user in Core.users) { | |
| sockets.add(Socket.connect(user.server.address, user.server.port)); | |
| } | |
| Future returned = new Future(_client_future); | |
| Future.wait(sockets).then((List<Socket> socks) { | |
| for(Socket socket in socks) | |
| _handle_client(socket); | |
| _client_status = false; | |
| }); | |
| return returned; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment