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

Re: Getting the IP address with remote DO


  • Subject: Re: Getting the IP address with remote DO
  • From: Andrew Zamler-Carhart <email@hidden>
  • Date: Sun, 25 Aug 2002 13:10:37 -0700

Another way of doing this is to have the clients cache their own IP address using [[NSHost currentHost] address], and then give the server a way to message the client for the cached value. That's what I do and it's very clean.

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.

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

  • Prev by Date: Carbon Handles & NSData
  • Next by Date: Re: [Q] Trouble setting an image in an NSOutlineView
  • Previous by thread: Re: Getting the IP address with remote DO
  • Next by thread: Re: Getting the IP address with remote DO
  • Index(es):
    • Date
    • Thread