Obsolete
/
libipc-old
Archived
3
0
Fork 0

Remove debug print.

master
Philippe Pittoli 2023-01-18 22:38:17 +01:00
parent 2befab21e2
commit 9dc4cfa003
1 changed files with 1 additions and 7 deletions

View File

@ -1,5 +1,5 @@
const std = @import("std"); const std = @import("std");
const hexdump = @import("./hexdump.zig"); // const hexdump = @import("./hexdump.zig");
const testing = std.testing; const testing = std.testing;
const net = std.net; const net = std.net;
const os = std.os; const os = std.os;
@ -152,7 +152,6 @@ pub const Context = struct {
} }
var response: []u8 = reception_buffer[0..reception_size]; var response: []u8 = reception_buffer[0..reception_size];
// print ("receive_fd:message received: {s} (len: {})\n", .{response, reception_size});
if (! std.mem.eql(u8, response, "ok")) { if (! std.mem.eql(u8, response, "ok")) {
return error.IPCdFailedNotOk; return error.IPCdFailedNotOk;
@ -247,7 +246,6 @@ pub const Context = struct {
try self.server_path(service_name, writer); try self.server_path(service_name, writer);
var path = fbs.getWritten(); var path = fbs.getWritten();
// print("context server init {s}\n", .{path});
var server = net.StreamServer.init(.{}); var server = net.StreamServer.init(.{});
var socket_addr = try net.Address.initUnix(path); var socket_addr = try net.Address.initUnix(path);
try server.listen(socket_addr); try server.listen(socket_addr);
@ -275,7 +273,6 @@ pub const Context = struct {
} }
pub fn schedule (self: *Self, m: Message) !void { pub fn schedule (self: *Self, m: Message) !void {
print ("scheduling new message {}\n", .{m});
try self.tx.append(m); try self.tx.append(m);
} }
@ -368,9 +365,7 @@ pub const Context = struct {
// Polling. // Polling.
var count: usize = undefined; var count: usize = undefined;
// print("fds: {any}\n", .{self.pollfd.items});
count = try os.poll(self.pollfd.items, wait_duration); count = try os.poll(self.pollfd.items, wait_duration);
// print("fds NOW: {any}\n", .{self.pollfd.items});
if (count < 0) { if (count < 0) {
print("there is a problem: poll < 0\n", .{}); print("there is a problem: poll < 0\n", .{});
@ -407,7 +402,6 @@ pub const Context = struct {
.SWITCH_RX => { .SWITCH_RX => {
try self.schedule(current_event.m.?); try self.schedule(current_event.m.?);
}, },
// TODO: DISCONNECTION and ERROR do not handle errors.
.DISCONNECTION => { .DISCONNECTION => {
var dest = try self.switchdb.getDest(fd.fd); var dest = try self.switchdb.getDest(fd.fd);
print("disconnection from {} -> removing {}, too\n", .{fd.fd, dest}); print("disconnection from {} -> removing {}, too\n", .{fd.fd, dest});