Re: port number for NSSocketPort
Re: port number for NSSocketPort
- Subject: Re: port number for NSSocketPort
- From: j o a r <email@hidden>
- Date: Thu, 29 May 2003 11:08:44 +0200
On Thursday, May 29, 2003, at 05:14 Europe/Stockholm, Lloyd Dupont
wrote:
I'm using DO over the network using NSSocketPort
I init a [myNSSocketPort initWithTcpPort:0], so a port is chosen for
me.
however I do need to know the port to register my object with
Rendezvous
how could I know the port number of my NSSocketPort ?
Perhaps this will work:
#import <netinet/in.h>
#include <arpa/inet.h>
{
struct sockaddr_in addrIn = *(struct sockaddr_in *)[[myNSSocketPort
address] bytes];
NSLog(@"Port: %d", addrIn.sin_port);
}
Hacked together in mail, so I'm not sure it works - but it could be
worth a try.
Why don't you just pick a port number youself?
j o a r
_______________________________________________
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.