Re: Getting the IP address with remote DO
Re: Getting the IP address with remote DO
- Subject: Re: Getting the IP address with remote DO
- From: j o a r <email@hidden>
- Date: Sun, 25 Aug 2002 12:59:59 +0200
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.