Trouble connecting to NSNetService
Trouble connecting to NSNetService
- Subject: Trouble connecting to NSNetService
- From: Rick Mann <email@hidden>
- Date: Thu, 25 Sep 2014 04:06:15 -0700
Continuing the saga of using this net service…
I have a BeagleBone Black running Debian that's using Avahi to (statically) advertise a service on port 2002. The BBB is named "balloon". It is connected via Ethernet and is hosting a Wi-Fi network named "Balloon." The Ethernet interface is on 192.168.1/24, and the Wi-Fi interface is 10.77.80/24.
I am able to discover the service, but when I attempt to connect to it from a Mac (iOS Simulator) that is connected to the 192.168.1/24 network via Ethernet, I get the following in the logs:
2014-09-25 04:04:03.157 Balloon[94614:3454106] <AppDelegate.m: 123>: Found service: <NSNetService 0x7fcc2bf180d0> local. _mavlink._tcp. balloon MAVLink
2014-09-25 04:04:03.588 Balloon[94614:3454106] <AppDelegate.m: 141>: Hostname: balloon.local.
2014-09-25 04:04:03.588 Balloon[94614:3454106] <AppDelegate.m: 142>: Port: 2002
2014-09-25 04:04:03.588 Balloon[94614:3454106] <AppDelegate.m: 143>: 2 addresses
2014-09-25 04:04:03.588 Balloon[94614:3454106] <AppDelegate.m: 149>: Address: 192.168.15.59:53767
2014-09-25 04:04:03.588 Balloon[94614:3454106] <AppDelegate.m: 149>: Address: 0.0.0.0:53767
2014-09-25 04:04:03.653 Balloon[94614:3454106] <NetServiceMAVLink.m: 64>: An error occured on stream <__NSCFInputStream: 0x7fcc2bc44130>: Error Domain=NSPOSIXErrorDomain Code=57 "The operation couldn’t be completed. Socket is not connected"
2014-09-25 04:04:03.660 Balloon[94614:3454106] <NetServiceMAVLink.m: 64>: An error occured on stream <__NSCFOutputStream: 0x7fcc2bc412c0>: Error Domain=NSPOSIXErrorDomain Code=57 "The operation couldn’t be completed. Socket is not connected"
Sometimes I get a "stream opened" event before the error events.
But, if I open a terminal window and type:
$ $ nc balloon.local 2002
It connects just fine and the terminal starts to fill with the data being sent from the BBB on that port.
If instead I run the code on an iPad connected to the Balloon Wi-Fi network, it connects and gets the data.
Any ideas what's going on? Thanks!
--
Rick Mann
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden