Long Time Dealy When getting Vended Object
Long Time Dealy When getting Vended Object
- Subject: Long Time Dealy When getting Vended Object
- From: Kiran Kumar S <email@hidden>
- Date: Wed, 22 Apr 2009 11:44:23 +0530
Hi,
Really going mad, it is taking long time response when i am trying
to get vended Object from the remote machine which doesn't exist in
the network. .
I am facing same long time delay(more than 60 sec) when i am trying
to get vended object from the remote machine which gone to sleep.
Below is the code
-(id)serverObject {
id serverObject = nil;
@try{
serverObject = [[self serverConnection] rootProxy];
}@catch(NSException *exception) {
serverObject = nil;
[self destroyConnection];
}
return serverObject;
}
-(NSConnection *)serverConnection {
if(!serverConnection) {
NSString *webAppURLString = [[NSUserDefaults standardUserDefaults]
objectForKey:kPXWebAppURL];
NSString *host = nil;
if(!(webAppURLString && [webAppURLString length] > 0)) {
host =[[NSProcessInfo processInfo] hostName];
} else {
host = [[NSURL URLWithString:webAppURLString] host];
}
NSSocketPort *port = [[NSSocketPort alloc]
initRemoteWithTCPPort:PORT_NUMBER host:host];
serverConnection = [[NSConnection alloc] initWithReceivePort:nil
sendPort:port];
[serverConnection setDelegate:self];
[serverConnection setRequestTimeout:1.0f];
[serverConnection setReplyTimeout:1.0f];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleConnectionDied:)
name:NSConnectionDidDieNotification object:serverConnection];
[port release];
}
return serverConnection;
}
Please help me out in this
Regards
SKiranKumar
_______________________________________________
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