Working with is CFStreamCreatePairWithSocketToHostalways convenient:
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault,
(CFStringRef) hostnameOrIp,
aPort,
&readStream,
&writeStream);
since he will immediately deliver the goods to you (pipe r and w). Unfortunately, CFReadStreamReadand CFWriteStreamRead. Is there an easy way to set the timeout (e.g. with streamOption)? They work in a thread - and since there are several parallel parallels, you would like to avoid runloop / signals - since any other pending reads / writes should not be interrupted).
Thank,
Dw.
source
share