使用CFStreamCreatePairWithSocketToHost总是很方便:CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault,(CFStringRef)hostnameOrIp,aPort,&readStream,&writeStream);因为它会立即为您提供cargo(r和w管道)。不幸的是CFReadStreamRead和CFWriteStreamRead阻塞。有没有一种干净的方法来设置超时(例如使用streamOption)?它们在一个线程中运行——因为有相当多的并行操作——希望避免运行循环/信号——因为任何其