I am writting the appliacation that is using client-server communication. I was tried to find the way to discover free socket port on mac and was not able to find one using objc. Is there a way to discover free port on mac using objective-c.
I am aware how to do this in C but I wonder if there is a not C way.
答案 0 :(得分:0)
您可以制作NSSocketPort
,然后解析其address
(struct sockaddr_in
的字节数。)