Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[netsend -u] shouldn't disconnect if there is no receiver #373

Closed
Spacechild1 opened this issue May 31, 2018 · 7 comments
Closed

[netsend -u] shouldn't disconnect if there is no receiver #373

Spacechild1 opened this issue May 31, 2018 · 7 comments
Labels
bug/fix either a bug (for issues) or a bugfix (for pull-requests) feature suggestion for an enhancement

Comments

@Spacechild1
Copy link
Contributor

Spacechild1 commented May 31, 2018

Let's say I have a [netsend -u] object. Whenever I send one or more messages while there's currently no listener, I get one of the following socket errors:

netsend: Unknown error (10057)

warning: 812 removed from poll list but not found


netsend: Unknown error (10038)

warning: 836 removed from poll list but not found

the sender has basically shut down and I can't send any more messages until I "reconnect".

this behaviour makes sense for [netsend] in TCP mode where you really have a connection, but UDP is connectionless and the sender shouldn't care if someone is listening.
for example, [iemnet/udpsend] gets it right: you can "connect" and send bytes no matter if there's a listener or not, but with [netsend -u] you have to make sure to not send any message
a) before the listener is opened.
b) whenever the listener is (temporarily) gone.

this kind of defeats the purpose of using UDP...

I'm on Windows 7, Pd 0.48.1. Does this also happen on Linux and OSX?

@umlaeute
Copy link
Contributor

otoh, you could simply issue a [disconnect, connect <HOST> <PORT>( message whenever the object tells you that it has lost "connection".

@Spacechild1
Copy link
Contributor Author

Spacechild1 commented Jun 25, 2018

this is a valid workaround, but I still think it's a bug we should fix. I basically don't understand why [netsend -u] cares at all if the endpoint exists... I'll have a look in the code to see what's going on.

@danomatika
Copy link
Contributor

I find it useful that it prints the fact there is no-one to receive the message. Closing the socket keeps messages for being printed over and over.

@danomatika danomatika changed the title [netsend -u] "warning: 208 removed from poll list" [netsend -u] shouldn't disconnect if there is no receiver Sep 14, 2018
@danomatika danomatika added the feature suggestion for an enhancement label Sep 14, 2018
@Spacechild1
Copy link
Contributor Author

A UDP socket shouldn't care if someone is receiving the message.

@danomatika
Copy link
Contributor

... but it's not a bad idea to know the receiver isn't there. From what I've read of the IP & sockets API, the connection refused error is thrown in the IP layer and sent up to the application layer. So even though the concept of the UDP message is "connectionless", the application has to decide to ignore the error directly. In this case, I don't think we'd want to change the current behavior but perhaps add a new creation flag to ignore the error per-instance.

@danomatika
Copy link
Contributor

I actually think this is more of a bug fix now...

@danomatika danomatika added the bug/fix either a bug (for issues) or a bugfix (for pull-requests) label Aug 11, 2019
@Spacechild1
Copy link
Contributor Author

already fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/fix either a bug (for issues) or a bugfix (for pull-requests) feature suggestion for an enhancement
Projects
None yet
Development

No branches or pull requests

3 participants