iOS - CFSocket 的使用
1、CFSocket 苹果对对底层 BSD Socket 进行轻量级的封装(纯 C)。 主要使用的 API:CFSocekt 用于建立连接,CFStream 用于读写数据。 2、基本使用 2.1 Client 客户端 TCP 客户端 // 包含头文件 #import <sys/socket.h> #import <netinet/in.h> #import <arpa/inet.h> @property (weak, nonatomic) IBOutlet UITextField *desIPTF; @property (weak, nonatomic) IBOutlet UITextField *desPortTF; @property (weak, nonatomic) IBOutlet UITextView *recvTextView; @property (weak, nonatomic) IBOutlet UITextField *sendTF; @property (nonatomic, assign) CFSocketRef clien...