• 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
IP address from NSFileHandle?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IP address from NSFileHandle?


  • Subject: IP address from NSFileHandle?
  • From: Andrew Bush <email@hidden>
  • Date: Sun, 11 Sep 2005 17:54:56 +1200

Hi all,

is this possible? Im playing around with the bonjour examples picturesharer and picturebrowser.

what I would like to do is tweak the server code such that it captures the ip address of the incoming connection.

It looks and feels as if there should be some way to do what I want by doing <something> with the file descriptor of the NSFileHandle that the notification passes in, but Im not finding anything in google or elsewhere.

<g> what am I missing? it is stupidly easy or entirely impossible and a stupid question?

the code to deal with the incoming connection is:

- (void)connectionReceived:(NSNotification *)aNotification {
NSFileHandle * incomingConnection = [[aNotification userInfo] objectForKey:NSFileHandleNotificationFileHandleItem];
NSData * representationToSend = [[imageView image] TIFFRepresentation];
[[aNotification object] acceptConnectionInBackgroundAndNotify];
[incomingConnection writeData:representationToSend];
[incomingConnection closeFile];
numberOfDownloads++;
[longerStatusText setStringValue:[NSString stringWithFormat:@"Click Stop to turn off Picture Sharing.\nNumber of downloads this session: %d.", numberOfDownloads]];
}
@end



thanks for any help.


Yours cheerfully,


Andrew Bush

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: IP address from NSFileHandle?
      • From: Pontus Ilbring <email@hidden>
  • Prev by Date: NSTableView Header
  • Next by Date: Re: Old NeXT code
  • Previous by thread: Re: NSTableView Header
  • Next by thread: Re: IP address from NSFileHandle?
  • Index(es):
    • Date
    • Thread