From: Michal Sojka Date: Thu, 26 Nov 2009 18:17:31 +0000 (+0100) Subject: Do not use connect() for UDP sockets X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/fwp.git/commitdiff_plain/8368f4f3c03bfb998692c3f4c272858c050d7fdd Do not use connect() for UDP sockets 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. --- diff --git a/fwp/lib/fwp/fwp_endpoint.c b/fwp/lib/fwp/fwp_endpoint.c index 05d4dd7..6c2bf68 100644 --- a/fwp/lib/fwp/fwp_endpoint.c +++ b/fwp/lib/fwp/fwp_endpoint.c @@ -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;