Re: More newbie CF[Socket|Stream] questions
Re: More newbie CF[Socket|Stream] questions
- Subject: Re: More newbie CF[Socket|Stream] questions
- From: Becky Willrich <email@hidden>
- Date: Thu, 23 May 2002 11:32:43 -0700
1. In my CFSocket listener callback, I don't want a client at this time. Can I just call close() on the CFSocketNativeHandle passed in the data parameter?
Yes.
2. Is there a way to get the IP address of the machine through CFWhatever, or should I do it as Stevens's UNP says? (Yes, I know that it could be multihomed...)
Do it the way Stevens' UNP says. On the other hand, if you want to know what IP address is being used for the local end of a particular connection, get the native socket for that connection and ask it for its local address.
3. kCFStreamPropertySocketRemoteHostName isn't working for me. In the listener callback, I create the pair of streams from the socket I'm passed, schedule them with the run loop, open them, and I'm still getting null back from CF[Read|Write]StreamCopyProperty. What am I doing wrong here?
kCFStreamPropertySocketRemoteHostName only lets you recover the host name you provided; it doesn't cause a reverse lookup on the remote address of a socket. You'll have to retrieve the native socket, get the remote address from it, then do the reverse lookup yourself.
Hope that helps,
REW
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.