porting code that uses NSSocketPort

Morgan Giddings <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Message-ID <[email protected]>
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
[email protected]
http://bioinfo.unc.edu/giddings.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.