]> rtime.felk.cvut.cz Git - frescor/forb.git/blobdiff - src/port.h
forb: Split forb_port_destroy() to stop and destroy phases
[frescor/forb.git] / src / port.h
index c293dcf17fd67215a71a47c786820687ee8dc0d1..4d0d010c8a6d2bdf9b10bcf34f0f33ad922668f7 100644 (file)
@@ -61,6 +61,7 @@
 #include <forb/syncobj.h>
 
 struct forb_proto;
+struct forb_peer;
 
 /**
  * Description of a port. Needs to be filled for forb_register_port().
@@ -91,6 +92,13 @@ typedef struct forb_port {
        ul_list_node_t node;              /**< Node in forb's port list */
        ul_list_head_t peers;             /**< Peers discovered on this port by discovery protocol */
        bool finish;                      /**< True when the threads should finish their execution, false otherwise. */
+
+       /** Peer discovered by another mean than discovery
+        * protocol. This field may be set by the protocol whenever it
+        * receives a message (e.g. request) from a new peer. This is
+        * to overcome limitations of discovery protocol on unreliable
+        * medium. */
+       struct forb_peer *new_peer;
 } forb_port_t;
 
 UL_LIST_CUST_DEC(forb_port,    /* cust_prefix */
@@ -100,6 +108,7 @@ UL_LIST_CUST_DEC(forb_port, /* cust_prefix */
                 node)          /* cust_node_field */
 
 int forb_register_port(forb_orb orb, forb_port_t *port);
+void forb_stop_port(forb_port_t *port);
 void forb_destroy_port(forb_port_t *port);