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
| const std = @import("std"); | |
| const ConnectionContext = struct { | |
| allocator: *std.mem.Allocator, | |
| conn: std.net.StreamServer.Connection, | |
| server: *std.net.StreamServer, | |
| finished: bool = false, | |
| thread: ?*std.Thread = null, | |
| }; |
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
| const std = @import("std"); | |
| const TimeOffset = struct { | |
| from: i64, | |
| offset: i16, | |
| }; | |
| const timeOffsets_Berlin = [_]TimeOffset{ | |
| TimeOffset{ .from = 2140045200, .offset = 3600 }, // Sun Oct 25 01:00:00 2037 | |
| TimeOffset{ .from = 2121901200, .offset = 7200 }, // Sun Mar 29 01:00:00 2037 |
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
| const std = @import("std"); | |
| pub const io_mode = .evented; | |
| pub fn main() !void { | |
| var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
| defer _ = gpa.deinit(); | |
| const allocator = &gpa.allocator; | |
| const req_listen_addr = std.net.Address.parseIp4("127.0.0.1", 9000) catch unreachable; |