advertisement

Article:
  Incorporating Rendezvous into Your Cocoa Applications, Part 2
Subject:   Cocoa Port Allocation
Date:   2003-10-26 02:34:13
From:   rjimlad
Response to: Cocoa Port Allocation

Ugly, but it should work:


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.