[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with NSSocketPort and DO on WINDOWS
From: |
Samantha Rahn |
Subject: |
Problems with NSSocketPort and DO on WINDOWS |
Date: |
Fri, 19 Jun 2009 11:03:01 -0400 |
All,
I have been having a variety of trouble with DO on Windows when
communicating across hosts. In order to diagnose the problem, I have
simplified my code to avoid the name server and simply use DO with
sockets (NSSocketPort). After setting up 2 processes, my client code
fails when trying to acquire the rootProxy from the connection. An
error is evidenced on the server side.
The server error occurs in the NSSocketPort class when the message is
received. The error message is:
"No handle for event rport on descriptor 0"
Client code:
- (BOOL)connectToHost:(NSString *)aHost
{
NSHost *host = aHost ? [NSHost hostWithName:aHost] : nil;
NSSocketPort *receivePort = [NSSocketPort portWithNumber:3999
onHost:host forceAddress:nil listener:YES];
NSSocketPort *sendPort = [NSSocketPort portWithNumber:3998
onHost:host forceAddress:nil listener:NO];
NSConnection *connection = [NSConnection
connectionWithReceivePort:receivePort sendPort:sendPort];
BOOL status = connection!=nil;
if(status)
{
ASSIGN(rootProxy, [connection rootProxy]); // Error occurs on
server prompted from this client call.
ASSIGN(hostName, aHost);
}
return rootProxy!=nil;
}
Server code:
- (void)start
{
NSSocketPort *receivePort = [NSSocketPort portWithNumber:3998
onHost:nil forceAddress:nil listener:YES];
NSSocketPort *sendPort = [NSSocketPort portWithNumber:3999
onHost:nil forceAddress:nil listener:NO];
ASSIGN(connection, [NSConnection
connectionWithReceivePort:receivePort sendPort:sendPort]);
[connection setRootObject:self];
}
}
Thanks,
Sam
- Problems with NSSocketPort and DO on WINDOWS,
Samantha Rahn <=