help-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

porting code that uses NSSocketPort


From: Morgan Giddings
Subject: porting code that uses NSSocketPort
Date: Wed, 14 Sep 2005 23:27:42 -0400

Hi
I have a command-line app I am trying to port from Mac OS X to GNUStep. It makes extensive use of NSSocketPort. I'm running into troubles, because it appears that the class interface definition for NSPort under GNUStep is different than in Cocoa.

In Cocoa, I'm using:

    NSSocketPort *port = [[NSSocketPort alloc] initWithTCPPort:portNo];

However, -initWithTCPPort doesn't seem to be defined in the header for NSPort.h on GNUStep (there is a section there which lists this method, but it is commented out).

Instead, the NSPort.h header file for GNUStep suggests using:
+ portWithNumber: onHost: forceAddress: listener:

Now, I think I could make this work, but... this seems really kludgey, since this particular interface doesn't exist on OSX. Therefore, it seems I'd have to start putting a bunch of #ifdefs in the code depending on whether compiling for OSX or GNUStep.
Why not just define an -initWithTCPPort for GNUStep's NSPort?

Am I missing something here?

Thanks!

Morgan Giddings
Assistant Professor, Departments of Microbiology & Immunology and Biomedical Engineering
(919) 843-3513
giddings@unc.edu
http://bioinfo.unc.edu/giddings.html






reply via email to

[Prev in Thread] Current Thread [Next in Thread]