]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Do not use connect() for UDP sockets
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 26 Nov 2009 18:17:31 +0000 (19:17 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 26 Nov 2009 18:17:31 +0000 (19:17 +0100)
If connect() is used to set socket address, we get error when there is
nobody on the receiving side. This breaks our ffmpeg-based tests.

fwp/lib/fwp/fwp_endpoint.c

index 05d4dd755554ea631c5684154d8fd51c46155281..6c2bf6855039fb6392eb4355a8b8560f5fa757de 100644 (file)
@@ -241,13 +241,15 @@ int fwp_send_endpoint_create(unsigned int node,
                        goto err;
        }
 
+#if 0
+       /* TODO: Allow using connect if it is specified in attr */
        if (connect(fwp_epoint->sockd,
                        (struct sockaddr*) &fwp_epoint->peer.addr, 
                        fwp_epoint->peer.addrlen)) {
                FWP_DEBUG("FWp connect error\n"); 
                goto err;
        }
-       
+#endif
        FWP_DEBUG("FWP Send endpoint created.\n"); 
 
 #ifdef FWP_WITHOUT_CONTNEGT
@@ -587,6 +589,8 @@ ssize_t fwp_endpoint_do_send(struct fwp_endpoint *ep,
        iov.iov_base = (void*)data;
        iov.iov_len = size;
 
+       msg.msg_name = &ep->peer.addr;
+       msg.msg_namelen = ep->peer.addrlen;
        msg.msg_iov = &iov;
        msg.msg_iovlen = 1;