Obsolete
/
libipc-old
Archived
3
0
Fork 0

Switch, IPCd and TCPd are working.

master
Philippe Pittoli 2023-01-11 15:59:35 +01:00
parent 871b2b249c
commit 1e3c1b2625
3 changed files with 1 additions and 3 deletions

View File

@ -464,11 +464,9 @@ pub const Context = struct {
// SWITCHED = write message for its switch buddy (callbacks) // SWITCHED = write message for its switch buddy (callbacks)
if (self.connections.items[i].t == .SWITCHED) { if (self.connections.items[i].t == .SWITCHED) {
current_event = self.switchdb.handle_event_write (i, m); current_event = self.switchdb.handle_event_write (i, m);
// TODO: remove the message from the tx array.
// Message inner memory is already freed. // Message inner memory is already freed.
switch (current_event.t) { switch (current_event.t) {
.SWITCH_TX => { .SWITCH_TX => {
try self.schedule(current_event.m.?);
}, },
.ERROR => { .ERROR => {
var dest = try self.switchdb.getDest(fd.fd); var dest = try self.switchdb.getDest(fd.fd);

View File

@ -175,6 +175,7 @@ fn create_service() !void {
try ctx.write(message); try ctx.write(message);
var response_from_service = try ctx.read_fd(servicefd); var response_from_service = try ctx.read_fd(servicefd);
if (response_from_service) |r| { if (response_from_service) |r| {
defer r.deinit();
if (std.mem.eql(u8, r.payload, "ok")) { if (std.mem.eql(u8, r.payload, "ok")) {
// OK // OK
print("service has established the connection\n", .{}); print("service has established the connection\n", .{});

View File

@ -289,6 +289,5 @@ fn default_out (origin: i32, m: *const Message) CBEventType {
// returning basic errors, no details. // returning basic errors, no details.
_ = m.write(writer) catch return CBEventType.ERROR; _ = m.write(writer) catch return CBEventType.ERROR;
_ = stream.write (fbs.getWritten()) catch return CBEventType.ERROR; _ = stream.write (fbs.getWritten()) catch return CBEventType.ERROR;
return CBEventType.NO_ERROR; return CBEventType.NO_ERROR;
} }