2022-12-11 02:47:11 +00:00
|
|
|
const std = @import("std");
|
|
|
|
const network = @import("network");
|
2022-12-15 02:54:08 +00:00
|
|
|
const Server = @import("Server.zig");
|
2022-12-11 02:47:11 +00:00
|
|
|
|
|
|
|
const Allocator = std.mem.Allocator;
|
|
|
|
const Socket = network.Socket;
|
|
|
|
|
|
|
|
pub fn main() !void {
|
2022-12-15 02:54:08 +00:00
|
|
|
const log = std.log.scoped(.Main);
|
2022-12-11 02:47:11 +00:00
|
|
|
|
|
|
|
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
|
|
|
defer std.debug.assert(!gpa.deinit());
|
|
|
|
|
|
|
|
const allocator = gpa.allocator();
|
|
|
|
|
2022-12-15 02:54:08 +00:00
|
|
|
var server = try Server.init();
|
|
|
|
defer server.deinit(allocator);
|
2022-12-11 02:47:11 +00:00
|
|
|
|
2022-12-15 02:54:08 +00:00
|
|
|
try server.run(allocator);
|
2022-12-11 02:47:11 +00:00
|
|
|
|
|
|
|
log.info("Client disconnected", .{});
|
|
|
|
}
|