]> rtime.felk.cvut.cz Git - frescor/forb.git/commitdiff
Disable discovery protocol when INET is default
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 26 May 2009 15:01:50 +0000 (17:01 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 26 May 2009 15:38:18 +0000 (17:38 +0200)
src/port.c
src/proto_inet.c

index f38eb87493f1f345df777da120e15512b053c7a3..60121b089f6bf5121b51d5f18606876fbcdfc19f 100644 (file)
@@ -164,7 +164,9 @@ void forb_destroy_port(forb_port_t *port)
        forb_syncobj_signal(&port->hello);
        
        pthread_join(port->receiver_thread.pthread_id, &thread_return);
+#ifndef CONFIG_FORB_PROTO_INET_DEFAULT
        pthread_join(port->discovery_thread.pthread_id, &thread_return);
+#endif
 
        if (port->desc.proto->port_destroy) {
                port->desc.proto->port_destroy(port);
index c7874c3e2ecfc0786ce7e5f4cd141908422a547e..8442dfc2d484bf4f713b20cdc8af06a3bc412610 100644 (file)
@@ -58,6 +58,7 @@
 #include <sys/types.h>
 #include <ul_log.h>
 #include <unistd.h>
+#include <forb/config.h>
 
 /**
  * @file   proto_inet.c
@@ -560,13 +561,15 @@ forb_inet_port_init(struct forb_port_desc *port_desc, struct in_addr listen_on,
                        port_priv->listen_socket, &ev);
        if (ret)
                goto err_close_epoll;
-       
+
+#ifndef CONFIG_FORB_PROTO_INET_DEFAULT 
        ev.events = EPOLLIN | EPOLLET;
        ev.data.fd = port_priv->udp_socket;
        ret = epoll_ctl(port_priv->epoll_fd, EPOLL_CTL_ADD,
                        port_priv->udp_socket, &ev);
        if (ret)
                goto err_close_epoll;
+#endif
 
        port_desc->proto = &proto_inet;
        port_desc->proto_priv = port_priv;