| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hello,
Thanks, Samuel
Attachment:
testnshost.m
Description: Binary data
On Jun 8, 2005, at 12:09 AM, Samuel Tesla wrote:
Hey all,
I ran across a very interesting problem with NSStream.
When I create an NSHost object, it appears to do its best to fill both the address and the names out. If I create it using and IP, it will do reverse DNS lookups. The interesting problem comes up when I create an NSHost from an IP address, but the hostname that reverse DNS finds is not a good one. In that case it gets errors when it tries to get the streams.
I've attached the program I used to generate the following output.
Here's a perfectly good host:
$ host 155.53.1.242
242.1.53.155.in-addr.arpa domain name pointer veal.babymeat.com.
$ host veal.babymeat.com
veal.babymeat.com has address 155.53.1.242
$ ./testnshost 155.53.1.242 7777
2005-06-07 23:51:48.215 testnshost[21836] Testing: 155.53.1.242 7777
2005-06-07 23:51:48.422 testnshost[21836] NSStreamEventOpenCompleted
2005-06-07 23:51:48.423 testnshost[21836] NSStreamEventOpenCompleted
2005-06-07 23:51:48.423 testnshost[21836] NSStreamEventHasSpaceAvailable
2005-06-07 23:51:48.543 testnshost[21836] NSStreamEventHasBytesAvailable
Here's a bad host:
$ host 212.13.197.5
5.197.13.212.in-addr.arpa domain name pointer sneaky.geekstuff.co.uk.
$ host sneaky.geekstuff.co.uk.
Host sneaky.geekstuff.co.uk not found: 3(NXDOMAIN)
$ ./testnshost 212.13.197.5 7773
2005-06-07 23:52:06.032 testnshost[21838] Testing: 212.13.197.5 7773
2005-06-07 23:52:06.051 testnshost[21838] NSStreamEventErrorOccurred: Error NSUnknownErrorDomain 7
2005-06-07 23:52:06.053 testnshost[21838] NSStreamEventErrorOccurred: Error NSUnknownErrorDomain 7
Anybody have an idea about this? It seems that NSStream is using [host name] instead of [host address]...but that seems odd.
Thanks, Samuel
_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.