[PD-dev] netsend/netreceive UDP ignore ECONNREFUSED

Dan Wilcox danomatika at gmail.com
Mon Mar 25 10:59:01 CET 2019


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...

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().

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...

> On Mar 25, 2019, at 3:42 AM, Chris McCormick <chris at mccormick.cx> wrote:
> 
> Hi Dan,
> 
> On 23/3/19 5:56 am, Dan Wilcox wrote:
>> 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.
> 
> 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.
> 
> Cheers,
> 
> Chris.
> 
> -- 
> https://mccormick.cx/
> 
> My tech development newsletter:
> https://mccormick.cx/subscribe

--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20190325/f0b0869e/attachment.html>


More information about the Pd-dev mailing list