Archived
3
0

Service name from ipcd to ipc. Some comments changes.

This commit is contained in:
Philippe Pittoli 2023-01-05 17:28:24 +01:00
parent d99a8d13e3
commit 2a714cd064
2 changed files with 8 additions and 10 deletions

View File

@ -130,7 +130,7 @@ pub const Context = struct {
try lookupwriter.print("{s};{s}", .{service_name, network_envvar});
// Try to connect to the IPCd service
var ipcdfd = try self.connect_service("ipcd");
var ipcdfd = try self.connect_service("ipc");
defer self.close_fd (ipcdfd) catch {}; // in any case, connection should be closed
// Send LOOKUP message

View File

@ -17,16 +17,14 @@ const print = std.debug.print;
const testing = std.testing;
const print_eq = @import("./util.zig").print_eq;
// TODO: standard library is unecessary complex regarding networking.
// Should libipc drop it and use plain old file descriptors instead?
// Standard library is unecessary complex regarding networking.
// libipc drops it and uses plain old file descriptors instead.
// TODO: path => std.XXX.YYY, not simple [] const u8
// API should completely obfuscate the inner structures.
// Only libipc structures should be necessary to write any networking code,
// users should only work with Context and Message, mostly.
// TODO: both Connection and pollfd store file descriptors.
// Connection stores either Stream (server) or Address (client).
// TODO: API should completely obfuscate the inner structures.
// Only structures in this file should be necessary.
// QUESTION: should libipc use std.fs.path and not simple [] const u8?
fn create_service() !void {
const config = .{.safety = true};
@ -38,7 +36,7 @@ fn create_service() !void {
defer ctx.deinit(); // There. Can't leak. Isn't Zig wonderful?
// SERVER SIDE: creating a service.
_ = try ctx.server_init("ipcd");
_ = try ctx.server_init("ipc");
// signal handler, to quit when asked
const S = struct {