nonoo / kappanhang

Remotely open audio channels and a serial port to an Icom RS-BA1 server (for ex. Icom IC-705 transceiver).
Other
152 stars 28 forks source link

Kappanhang attempts to open UDP sockets with locPort == remPort. This conflicts with other local software. #19

Closed VK2KTJ closed 2 years ago

VK2KTJ commented 2 years ago

Norbert, It appears that kappanhang attempts to open UDP sockets with the same local port number as it communicates to on the radio:

func (s *streamCommon) init(name string, portNumber int) error { ... hostPort := fmt.Sprint(connectAddress, ":", portNumber) ... raddr, err := net.ResolveUDPAddr("udp", hostPort) ... s.conn, err = net.DialUDP("udp", &net.UDPAddr{Port: portNumber}, raddr)

I have other software that I run on my machine that apparently also prefers to use one of the 5000x ports by default, and if I have it running when I start kappanhang, kappanhang fails to run. In order to have both running I have to ensure kappanhang runs first so that it can take the port and the other software then chooses another. This is awkward and catches me out many times.

Is there any reason that the local UDP ports could not be randomly assigned? Does the protocol mandate this behaviour?

regards Terry

nonoo commented 2 years ago

kappanhang mimicks the behavior of the original RS-BA1 Windows software, and it also uses the same source UDP ports.

VK2KTJ commented 2 years ago

Does the Windows software also fail if one of those ports is already open?

On Fri, 5 Nov. 2021, 19:23 Norbert Varga, @.***> wrote:

kappanhang mimicks the behavior of the original RS-BA1 Windows software, and it also uses the same source UDP ports.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nonoo/kappanhang/issues/19#issuecomment-961706679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASE7YGS6SS455CTYD4XPCGLUKOIB5ANCNFSM5HM3UAEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

VK2KTJ commented 2 years ago

fwiw, I have locally replaced the laddr spec with 'nil' and kappanhang is working fine with my IC705 using three locally, randomly assigned ports.

regards Terry

On Sat, 6 Nov 2021 at 08:52, Terry Dawson @.***> wrote:

Does the Windows software also fail if one of those ports is already open?

On Fri, 5 Nov. 2021, 19:23 Norbert Varga, @.***> wrote:

kappanhang mimicks the behavior of the original RS-BA1 Windows software, and it also uses the same source UDP ports.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nonoo/kappanhang/issues/19#issuecomment-961706679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASE7YGS6SS455CTYD4XPCGLUKOIB5ANCNFSM5HM3UAEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Terry Dawson, VK2KTJ