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

should reconnect instantiate a new socket on every attempt? #15

Closed
TomKaltz opened this issue Aug 14, 2016 · 5 comments
Closed

should reconnect instantiate a new socket on every attempt? #15

TomKaltz opened this issue Aug 14, 2016 · 5 comments

Comments

@TomKaltz
Copy link

I see that every time a connection is attempted a new udp socket is created. Should this be the case? Shouldn't the hello command just be sent out again only?

Also, I don't believe it's necessary do a manual bind since node auto-binds to a random port when you send out your first packets.

@miyukki
Copy link
Member

miyukki commented Aug 18, 2016

It is True.

@ghost
Copy link

ghost commented Nov 13, 2016

Yes, it's even worse: The existing UDP Sockets will not be closed when reconnecting. After a while at least on Windows an application will not be able to reconnect anymore as there are no local ports left. Do you have a quick fix for this?

@TomKaltz
Copy link
Author

I modified and moved creation of UDP socket to the constructor. It only
needs to be created once.

On Sun, Nov 13, 2016 at 7:40 AM, susdorf notifications@github.com wrote:

Yes, it's even worse: The existing UDP Sockets will not be closed when
reconnecting. After a while at least on Windows an application will not be
able to reconnect anymore as there are no local ports left. Do you have a
quick fix for this?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#15 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC0_IT9lmYI1XVkQcxLMWeWwI9mgRLhnks5q9wU2gaJpZM4Jj-VX
.

@ghost
Copy link

ghost commented Nov 14, 2016

Thanks, I have edited the connect method to close an existing socket before creating a new one. This has also worked for me. I did not know a reconnection is really needed or not and how ATEM handles clients internally. But good to know your approach also works fine.

@miyukki
Copy link
Member

miyukki commented Nov 15, 2016

@TomKaltz @susdorf
Now we pushed the new version that fixed udp initialization problem. Let's try it.
If you use local_port parameter calls connect() should be move to constructor options.

@miyukki miyukki closed this as completed Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants