• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSocketPortNameServer, DO & Daemon problems ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSocketPortNameServer, DO & Daemon problems ...


  • Subject: NSSocketPortNameServer, DO & Daemon problems ...
  • From: Lloyd Dupont <email@hidden>
  • Date: Fri, 9 May 2003 11:36:12 +1000

I use DO with NSSocketPort & NSSocketPortNameServer.
and that's ok.

however I recently tried to make my application a daemon.
so I initialize my application with stuff like:
pid_t pid;
if( (pid = fork()) < 0 )
return -1;
else if(pid != 0)
return 0;

setsid();
chdir("/");
umask(0);

and then register to DO with
NSSocketPort *sport = [[[NSSocketPort alloc] initWithTCPPort:aPort]
autorelease];
// fail on the line below
if([[NSSocketPortNameServer sharedInstance] registerPort:sport
name:aName] == NO)
return FALSE;
NSConnection * connection = [[[NSConnection alloc]
initWithReceivePort:sport sendPort:nil] autorelease];
[connection setRootObject:self];


however, when my program is running as a daemon it always fail to
register to DO with the following error:
"There was an error creating a resolve, (ipc/send) invalid destination
port"

I don't understand ... any idea ?
(and yes, the name and port are available)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: NSRunLoop mystery
  • Next by Date: Window's close, miniaturize, and resize controls become disabled after running alert sheet in a modal session
  • Previous by thread: Re: NSRunLoop mystery
  • Next by thread: Window's close, miniaturize, and resize controls become disabled after running alert sheet in a modal session
  • Index(es):
    • Date
    • Thread