static ssize_t channel_send(struct utcp *utcp, const void *data, size_t len) {
node_t *n = utcp->priv;
meshlink_handle_t *mesh = n->mesh;
- char hex[len * 2 + 1];
- bin2hex(data, hex, len);
- logger(mesh, MESHLINK_WARNING, "channel_send(%p, %p, %zu): %s\n", utcp, data, len, hex);
return meshlink_send(mesh, (meshlink_node_t *)n, data, len) ? len : -1;
}
node_t *n = (node_t *)source;
if(!n->utcp)
abort();
- char hex[len * 2 + 1];
- bin2hex(data, hex, len);
- logger(mesh, MESHLINK_WARNING, "channel_receive(%p, %p, %zu): %s\n", n->utcp, data, len, hex);
utcp_recv(n->utcp, data, len);
}
mesh->receive_cb = channel_receive;
for splay_each(node_t, n, mesh->nodes) {
if(!n->utcp && n != mesh->self) {
- logger(mesh, MESHLINK_WARNING, "utcp_init on node %s", n->name);
n->utcp = utcp_init(channel_accept, channel_pre_accept, channel_send, n);
}
}
return NULL;
}
- logger(mesh, MESHLINK_WARNING, "meshlink_channel_open(%p, %s, %u, %p, %p, %zu)\n", mesh, node->name, port, cb, data, len);
node_t *n = (node_t *)node;
if(!n->utcp) {
n->utcp = utcp_init(channel_accept, channel_pre_accept, channel_send, n);