Hi,
I have been looking this online but can't find specific for zig.
Tried to do it on but checking the docs of std but Im having an error error.AddressInUse.
const Server = std.net.StreamServer;
pub fn init() !void {
var server = Server.init(.{
.reuse_port = true,
.reuse_address = true,
});
defer server.deinit();
const path = "/tmp/project/";
const address = try std.net.Address.initUnix(path);
try server.listen(address);
var buff: [500]u8 = undefined;
while (true) {
const conn = try server.accept();
_ = try conn.stream.read(&buff);
}
}
is there a simple example I can check from to learn more about this?