summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/main.ha9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/main.ha b/client/main.ha
index a0c25d8..0065eb6 100644
--- a/client/main.ha
+++ b/client/main.ha
@@ -1,6 +1,7 @@
use fmt;
use sdl2;
use math;
+use net;
use net::dial;
def CHUNKSIZE = 512;
@@ -26,11 +27,17 @@ export fn main() void = {
append(pictures, picture_from_surface(surf, offs[i]));
};
+ const conn = match(dial::dial("tcp","localhost","41460")) {
+ case let c: net::socket => yield c;
+ case let err: net::error =>
+ fmt::fatal("couldn't connect to server:",net::strerror(err));
+ };
+
let dstate = drawing_state {
drawing = false,
pos = (0,0),
pictures = pictures,
- conn = dial::dial("tcp","localhost:41460","unknown")!,
+ conn = conn,
};
let camera_pos: pos = (25, 50);