• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to tell which interface is active on OS X ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to tell which interface is active on OS X ?


  • Subject: How to tell which interface is active on OS X ?
  • From: Matt Mashyna <email@hidden>
  • Date: Thu, 21 Mar 2002 11:35:16 -0500

I have been working on updating an ftp client implementation to run on OS X. While in progress I was adding support for non-passive data channels. Before the client can tell the server what port to use on the client, the client has to know it's own address. So, to get it I call:

OTInetGetInterfaceInfo(&info, 0);
OTInitInetAddress(&ipAddress, mPort, info.fAddress);

Works OK but then I realized that it was getting the address for the AirPort adapter rather than the ethernet adapter. If I change the interface number arg in OTInetGetInterfaceInfo to 1 I get the address for the ethernet adapter.

I thought that 0 asked for the default interface. I guess this is not the case. The location I have set up in the system preferences prefers ethernet before AirPort. What was more amazing was that when I ran Transmit to the same server and looked at the transcript window Transmit also went with the AirPort interface rather than the ethernet. That explains some of the crappy throughput I get sometimes when I'm in an office plugged into the 100BT but close enough to the AirPort hub to get a weak signal. My old office was too far from the hub to get a signal through the Ti shell so this never came up before.

Right, enough ranting. How do I determine what interface I should be using based on the system preferences on OS X and the location manager on OS 9.

Matt
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to tell which interface is active on OS X ?
      • From: Peter Sichel <email@hidden>
    • Re: How to tell which interface is active on OS X ?
      • From: Vincent Lubet <email@hidden>
  • Prev by Date: Service Lookup
  • Next by Date: Re: How to tell which interface is active on OS X ?
  • Previous by thread: Re: bind, connect, etc. and nonblocking mode
  • Next by thread: Re: How to tell which interface is active on OS X ?
  • Index(es):
    • Date
    • Thread