Ethernet / TCP socket direct to server device with static IP

Hi,

I have a hardware device that asks as an ethernet server.

I need to connect to it using a TCP socket over ethernet.

Problem is, I cannot find an API or example code on how to go about this. I have tried to search through the available network interfaces using AF_LINK (link layer) family but only the wifi shows up (en0), even when the device is connected and the iPhone self-assigns an IP etc.

Extra challenge is, I am using objective C because all of my other code is written that way. I'm happy to add a swift module where that is the only option.

Can someone please point me in the right direction?

Extra challenge is, I am using objective C

That’s not a problem. All the APIs in this space are available to both Swift and Objective-C [1].

Does your accessory support IPv6? Or just IPv4?

If it’s just IPv4, will it talk to clients with an IPv4 link-local address [2]? Or does it require the client to have a static IP address?

Do you have any control over the accessory firmware?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Indeed, things like BSD Sockets are much easier to call from C-based languages.

[2] Per RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses.

Ethernet / TCP socket direct to server device with static IP
 
 
Q