-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,11 @@ public void Open(string host, string port) | |
if (IsInRange("224.0.0.0", "239.255.255.255", hostEndPoint.Address.ToString())) | ||
{ | ||
log.Info($"UdpSerialConnect bind to port {Port}"); | ||
client = new UdpClient(int.Parse(Port), hostEndPoint.AddressFamily); | ||
|
||
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 commentThe 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 commentThe 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 |
||
|
||
IsOpen = true; | ||
|
||
|
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.