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

CommsUDPSerialConnect multicast to allow address reuse #3144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

magicrub
Copy link
Contributor

@magicrub magicrub commented Jul 5, 2023

When sending to a multicast port, such as 234.2.3.1:6969 for TAK, other apps on the same computer can't use that same multicast IP. Example: using WinTAK to test TAK messages from Mission Planner. There's an option in WinTAK networking settings to allow this, but for Mission Planner I think it's fine to always allow it

client = new UdpClient();
client.ExclusiveAddressUse = false;
client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
client.Connect(hostEndPoint.Address, hostEndPoint.Port);
Copy link
Contributor

@meee1 meee1 Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually removes the bind port, and changes to a connect vs a bind and listen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. We don't want to bind. We want two apps to be able to use the same multicast ip and port. If you don't like that, I suppose we could add a checkbox to enable/allow port-reuse in the CoT menu

@magicrub
Copy link
Contributor Author

This is the checkbox in WinTAK to enable this
image

@@ -171,7 +171,7 @@ void mainloop()

if (CoTStream != null && CoTStream.IsOpen)
{
CoTStream.WriteLine(xmlStr.Replace("\r", ""));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I added this but it doesn't really do anything and doesn't belong in this PR.

@magicrub
Copy link
Contributor Author

I'd also like to suggest having an option to ALWAYS do this, with a checkbox in the Config->Planner page.

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

Successfully merging this pull request may close these issues.

2 participants