Service name from ipcd to ipc. Some comments changes.
parent
d99a8d13e3
commit
2a714cd064
|
@ -130,7 +130,7 @@ pub const Context = struct {
|
||||||
try lookupwriter.print("{s};{s}", .{service_name, network_envvar});
|
try lookupwriter.print("{s};{s}", .{service_name, network_envvar});
|
||||||
|
|
||||||
// Try to connect to the IPCd service
|
// 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
|
defer self.close_fd (ipcdfd) catch {}; // in any case, connection should be closed
|
||||||
|
|
||||||
// Send LOOKUP message
|
// Send LOOKUP message
|
||||||
|
|
|
@ -17,16 +17,14 @@ const print = std.debug.print;
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
const print_eq = @import("./util.zig").print_eq;
|
const print_eq = @import("./util.zig").print_eq;
|
||||||
|
|
||||||
// TODO: standard library is unecessary complex regarding networking.
|
// Standard library is unecessary complex regarding networking.
|
||||||
// Should libipc drop it and use plain old file descriptors instead?
|
// 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.
|
// QUESTION: should libipc use std.fs.path and not simple [] const u8?
|
||||||
// Connection stores either Stream (server) or Address (client).
|
|
||||||
|
|
||||||
// TODO: API should completely obfuscate the inner structures.
|
|
||||||
// Only structures in this file should be necessary.
|
|
||||||
|
|
||||||
fn create_service() !void {
|
fn create_service() !void {
|
||||||
const config = .{.safety = true};
|
const config = .{.safety = true};
|
||||||
|
@ -38,7 +36,7 @@ fn create_service() !void {
|
||||||
defer ctx.deinit(); // There. Can't leak. Isn't Zig wonderful?
|
defer ctx.deinit(); // There. Can't leak. Isn't Zig wonderful?
|
||||||
|
|
||||||
// SERVER SIDE: creating a service.
|
// SERVER SIDE: creating a service.
|
||||||
_ = try ctx.server_init("ipcd");
|
_ = try ctx.server_init("ipc");
|
||||||
|
|
||||||
// signal handler, to quit when asked
|
// signal handler, to quit when asked
|
||||||
const S = struct {
|
const S = struct {
|
||||||
|
|
Reference in New Issue