-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
base: master
Are you sure you want to change the base?
Conversation
client = new UdpClient(); | ||
client.ExclusiveAddressUse = false; | ||
client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); | ||
client.Connect(hostEndPoint.Address, hostEndPoint.Port); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@@ -171,7 +171,7 @@ void mainloop() | |||
|
|||
if (CoTStream != null && CoTStream.IsOpen) | |||
{ | |||
CoTStream.WriteLine(xmlStr.Replace("\r", "")); |
There was a problem hiding this comment.
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.
I'd also like to suggest having an option to ALWAYS do this, with a checkbox in the Config->Planner page. |
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