expecting IPv6 (Re: Getting the IP address with remote DO)
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.