| Sign In/My Account | View Cart |
| Article: |
Incorporating Rendezvous into Your Cocoa Applications, Part 2 | |
| Subject: | Cocoa Port Allocation | |
| Date: | 2003-07-16 09:36:21 | |
| From: | anonymous2 | |
|
I have been trying similar things. The Apple sample code uses lowlevel bsd functions which I think look a little messy when it can be done using cocoa. My problem is querying a NSSocketPort to find it's port. for example;
|
||
Showing messages 1 through 1 of 1.
NSData *address=[sP address];
struct sockaddr_in remote_addr;
[address getBytes:&remote_addr length:sizeof(struct sockaddr_in)];
// take a look at address.sin_port. It *should* be the allocated port.