Re: NSSocketPort bug?
Re: NSSocketPort bug?
- Subject: Re: NSSocketPort bug?
- From: João Pavão <email@hidden>
- Date: Wed, 15 Dec 2004 14:03:21 +0000
From the documentation of initRemoteWithTCPPort:host:
"A connection is not opened to the remote host until data is sent."
initWithTCPPort: opens a port for listening, so it is already opened when you check the number with NSLog. Try checking the port number for the second code snippet after sending some data.
João Pavão
On Dec 15, 2004, at 10:30, Malte wrote:
This is a kind of follow up to the thread i've started earlier asking for help in the BSD <--> Cocoa Socket thing.
I narrowed something down that looks to me like a bug, but maybe i'm just doing something wrong.
Please give me some feedback on this:
When i call:
NSSocketPort * sockPort = [[NSSocketPort alloc] initWithTCPPort:12345];
int socketFD = [sockPort socket];
NSLog(@"server socketFD: %i", socketFD);
The NSLog message gives me a positive integer (i.e. 8 in this case) just like a fileDescriptor should be
However, when i substitute the above with this:
NSSocketPort * sockPort = [[NSSocketPort alloc] initRemoteWithTCPPort:12345 host:@"192.168.1.1"];
int socketFD = [sockPort socket];
NSLog(@"server socketFD: %i", socketFD);
The socketFD is *ALWAYS* == -1 !!
Can anyone verify this? Is this a bug or am i just doing something horribly wrong?
Thanks!
-malte
_______________________________________________
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
--
João Pavão
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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