1 Apr
2009
1 Apr
'09
12:58 a.m.
On 25/03/2009, at 6:03 AM, Brian Chapados wrote:
Since you have an NSData object, you should be able to convert it to a String (NSString) and then use unpack. For example:
socket_port = NSSocketPort.alloc.initWithTCPPort(11111) addr = socket_port.address addr_str = NSString.alloc.initWithData(addr, encoding:NSString.defaultCStringEncoding) port = addr_str.unpack("nn")[1] # seems to work - not sure what this should be
Thanks, Brian. That was just the ticket. Not sure why I didn't think of it! - Pete