<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>> For connectionless sending essentially, I think we would need to forego the call to connect() in netsend_connect and keep a copy of the socket address struct</div>

<div> </div>

<div>IIUC, 'connect' on a UDP sockket does exactly that: it doesn't really "connect" to anything but just stores the default destination address, so 'connect' + 'send' is equivalent to 'sendto'.</div>

<div>at least that's how it has always worked for me.</div>

<div> </div>

<div>http://man7.org/linux/man-pages/man2/connect.2.html</div>

<div> </div>

<div>Christof</div>

<div> 
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Montag, 25. März 2019 um 10:59 Uhr<br/>
<b>Von:</b> "Dan Wilcox" <danomatika@gmail.com><br/>
<b>An:</b> "Chris McCormick" <chris@mccormick.cx><br/>
<b>Cc:</b> pd-dev <pd-dev@lists.iem.at><br/>
<b>Betreff:</b> Re: [PD-dev] netsend/netreceive UDP ignore ECONNREFUSED</div>

<div name="quoted-content">
<div>Sure, however neither netsend nor udpsend work this way, so I was first trying to see what I could do without changing the internals a whole lot. It's definitely not "connectionless" when it keeps returning to a receiver...
<div> </div>

<div>For connectionless sending essentially, I think we would need to forego the call to connect() in netsend_connect and keep a copy of the socket address struct to use with sendto() instead of send() when actually sending. Since sendto() takes the address directly, it doesn't need a connect() ahead of time. Also, the UDP netsend / netreceive relay behavior could then use sendto() and recvfrom().</div>

<div> </div>

<div>So conceptually, the current behavior of calling connect() for both UDP and TCP needs to change and I'd think then the the "connected" outlet for UDP simply means the socket is set up, but has no connotation for a current "connection." Again, I'm not sure how that would affect patches which would rely on the old behavior...
<div> 
<blockquote>
<div>On Mar 25, 2019, at 3:42 AM, Chris McCormick <<a href="mailto:chris@mccormick.cx" onclick="parent.window.location.href='mailto:chris@mccormick.cx'; return false;" target="_blank">chris@mccormick.cx</a>> wrote:</div>
 

<div>
<div>Hi Dan,<br/>
<br/>
On 23/3/19 5:56 am, Dan Wilcox wrote:
<blockquote>From my reading on the socket API, sending a UDP message conceptually shouldn't care about whether the receiver is there. However this is detected on a lower networking layer and propagated up to the application layer where it can be used or ignored.</blockquote>
<br/>
You probably know this already but it is possible to operate UDP in connectionless or connection-oriented mode. Connection-oriented is somewhere between TCP and connectionless. In connection-oriented mode I suppose you would want to know if the other side is there or not, whereas with connectionless you probably just want to fire and forget. Not sure if this affects what you are doing but might help explain what you're seeing.<br/>
<br/>
Cheers,<br/>
<br/>
Chris.<br/>
<br/>
--<br/>
<a href="https://mccormick.cx/" target="_blank">https://mccormick.cx/</a><br/>
<br/>
My tech development newsletter:<br/>
<a href="https://mccormick.cx/subscribe" target="_blank">https://mccormick.cx/subscribe</a></div>
</div>
</blockquote>
</div>
 

<div>
<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;">--------</div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;">Dan Wilcox</div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"><a href="http://twitter.com/danomatika" target="_blank">@danomatika</a></div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"><a href="http://danomatika.com" target="_blank">danomatika.com</a></div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"><a href="http://robotcowboy.com" target="_blank">robotcowboy.com</a></div>

<div style="color: rgb(0,0,0);font-family: Helvetica;font-size: 12.0px;font-style: normal;font-weight: normal;letter-spacing: normal;text-indent: 0.0px;text-transform: none;white-space: normal;word-spacing: 0.0px;"> </div>
</div>
</div>
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at <a href="https://lists.puredata.info/listinfo/pd-dev" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a></div>
</div>
</div>
</div>
</div></div></body></html>