Re: TCPServer Example
Re: TCPServer Example
- Subject: Re: TCPServer Example
- From: Chris Suter <email@hidden>
- Date: Tue, 5 May 2009 14:03:28 +1000
On Tue, May 5, 2009 at 6:58 AM, Development <email@hidden> wrote:
> I'm using parts of the TCPServer example code from apple. It's fairly
> straight forward code however I have a problem.
>
> in the method:- (void)handleNewConnectionFromAddress:(NSData *)addr
> inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr
>
> I have the availability of the address of the connector in NSData format.
> What I cannot seem to figure out is how to gleen the actual address of the
> connecting peer from the NSData.
The NSData object contains a "struct sockaddr" which is defined in
/usr/include/sys/socket.h. It will usually be a struct sockaddr_in
which is defined in /usr/include/netinet/in.h.
Regards,
Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden