• 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
Re: Problems with NSSocketPort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with NSSocketPort


  • Subject: Re: Problems with NSSocketPort
  • From: Ben Lachman <email@hidden>
  • Date: Tue, 11 Feb 2003 00:00:00 -0500

Nick Zitzmann kindly reminded me that I had qouted the wrong version of my code. It should have been:

- (void)startOnPort:(short int)portNum {
NSSocketPort *port = [[NSSocketPort alloc] initWithTCPPort:portNum];
NSConnection *conn = [[NSConnection alloc] initWithReceivePort:port sendPort:nil];
...

The problem is that port is never non-NULL, which makes conn be NULL as well.

Any ideas?

->Ben


On Monday, February 10, 2003, at 10:19 PM, Ben Lachman wrote:

Hi,

I dug out some old distributed object code that I know used to work, but it doing weird stuff now. I can't seem to get a valid NSConnection no matter what I do. I'm including the code, any help would be appreciated.

- (void)startOnPort:(short int)portNum {
NSSocketPort *port = [NSSocketPort alloc];
NSConnection *conn = [NSConnection alloc];

[port initWithTCPPort:portNum];

if(port) {
[conn initWithReceivePort:port sendPort:nil];
} else {
NSLog(@"Null port object!");
}

[conn setDelegate:self];
[conn setRootObject:self];

[[NSRunLoop currentRunLoop] run];

[conn release];
[port release];
}
--
\|||/
(o o)
|~~~~ooO~~(_)~~~~~~~|
| Please |
| don't feed the |
| TROLLS |
'~~~~~~~~~~~~~~Ooo~~'
|__|__|
|| ||
ooO Ooo
_______________________________________________
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.

  • Follow-Ups:
    • Re: Problems with NSSocketPort
      • From: Douglas Davidson <email@hidden>
References: 
 >Problems with NSSocketPort (From: Ben Lachman <email@hidden>)

  • Prev by Date: Re: Finding an application ?
  • Next by Date: Saving state of outlineView AND Expanding all items
  • Previous by thread: Problems with NSSocketPort
  • Next by thread: Re: Problems with NSSocketPort
  • Index(es):
    • Date
    • Thread