IP address from NSFileHandle?
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