+ /// This functions is called to determine if we are listening for incoming channels.
+ /**
+ * The function is run in MeshLink's own thread.
+ * It is therefore important that the callback uses apprioriate methods (queues, pipes, locking, etc.)
+ * to pass data to or from the application's thread.
+ * The callback should also not block itself and return as quickly as possible.
+ *
+ * @param node A handle for the node that wants to open a channel.
+ * @param port The port number the peer wishes to connect to.
+ *
+ * @return This function should return true if the application accepts the incoming channel, false otherwise.
+ */
+ virtual bool channel_listen(node *node, uint16_t port) {
+ /* by default accept all channels */
+ (void)node;
+ (void)port;
+ return true;
+ }
+