From 28c63ce8d4533e27367f2d18137a7c12c0b96970 Mon Sep 17 00:00:00 2001 From: makefunstuff Date: Tue, 9 Jul 2024 01:02:14 +0300 Subject: update README and removed dumb helloworlds --- src/socket-server.zig | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/socket-server.zig (limited to 'src/socket-server.zig') diff --git a/src/socket-server.zig b/src/socket-server.zig deleted file mode 100644 index b77c4d5..0000000 --- a/src/socket-server.zig +++ /dev/null @@ -1,22 +0,0 @@ -const std = @import("std"); -const print = std.debug.print; -const net = std.net; - -pub fn start_server() !void { - print("Starting server\n", .{}); - - const ip = [_]u8{ 127, 0, 0, 1 }; - const port = 9000; - - const addr = net.Address.initIp4(ip, port); - - var server = try net.Address.listen(addr, .{}); - print("Listening at {}\n", .{server.listen_address}); - defer server.deinit(); - - while (true) { - var connection = try server.accept(); - _ = try connection.stream.write("Hello, client\n"); - defer connection.stream.close(); - } -} -- cgit 1.4.1-2-gfad0