• 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
expecting IPv6 (Re: Getting the IP address with remote DO)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

expecting IPv6 (Re: Getting the IP address with remote DO)


  • Subject: expecting IPv6 (Re: Getting the IP address with remote DO)
  • From: Chris Kane <email@hidden>
  • Date: Wed, 28 Aug 2002 09:44:26 -0700

Using inet_ntoa() assumes that the sockaddr_in is an IPv4 address. With 10.2 beginning to support IPv6 now, people should start being careful about this now, if the app is going to be around more than just a couple years.

People should refer to RFC 2553 if other information on IPv6-savvy socket/address APIs is scarce (I haven't looked in 10.2).

Chris Kane
Cocoa Frameworks, Apple

On Sunday, August 25, 2002, at 03:59 AM, j o a r wrote:

Get hold of the send port for the connection in question and do something like this:

#import <netinet/in.h>
#import <arpa/inet.h>

- (NSString *) addressFromSocketPort:(NSSocketPort *) port
{
struct sockaddr_in addrIn = *(struct sockaddr_in *)[[port address] bytes];

return [NSString stringWithFormat: @"%s", inet_ntoa(addrIn.sin_addr)];
}

On Sunday, Aug 25, 2002, at 11:42 Europe/Stockholm, kubernan wrote:

Hello,

When my server receives a client request (with NSConnection)
the server uses
[(NSDistantObject *)theProxy setProtocolForProxy:
@protocol(ClientProtocol)];

for sending results to the client. That's all and It works.
I'd like to know if there is a mean for the server to have the IP
address of the connected client.

Thx for your help.
K.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Getting the IP address with remote DO (From: j o a r <email@hidden>)

  • Prev by Date: Re: IB bug? - copyWithZone: selector not recognized
  • Next by Date: Re: Keeping track of files, i.e. aliases, NSURL's?
  • Previous by thread: Re: Getting the IP address with remote DO
  • Next by thread: Cocoa unzip?
  • Index(es):
    • Date
    • Thread