0
#import <sys/socket.h>
#import <netinet/in.h>
#import <arpa/inet.h>
我有導入上面的標題,但iphone TCPSocket頭文件?
setsockopt(CFSocketGetNative(TCPSocket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
顯示警告「使用未聲明的標識符‘的TCPSocket’的」;我需要導入其他頭文件?
地址:
CFSocketContext CTX = {0,self,NULL,NULL,NULL};
_socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, kCFSocketConnectCallBack, TCPServerConnectCallBack, &CTX);
setsockopt(CFSocketGetNative(_socket), SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
我已經insteaded _socket的的TCPSocket。