CFWriteStreamWrite Blocking if we give invalid Host.
CFWriteStreamWrite Blocking if we give invalid Host.
- Subject: CFWriteStreamWrite Blocking if we give invalid Host.
- From: "SridharRao M" <email@hidden>
- Date: Fri, 20 Jun 2008 10:38:16 +0530
Hi list,
I am using CFWriteStreamWrite to write some command on server and using CFReadStreamRef to retrieve some value from server.
CFWriteStreamWrite is blocking if we give invalid host address,instead it should return -1 as result.But it's blocking,
In the documentation it 's given as use CFWriteStreamCanAcceptBytes before writing .If i use the same am always getting boolean value False.so i am not able to write anything.
CFWriteStreamRef myWriteStream = Nil;
CFReadStreamRef myReadStream = Nil;
CFStreamCreatePairWithSocketToCFHost(kCFAllocatorDefault,host,SERVER_PORT,&myReadStream,&myWriteStream);
if (myWriteStream != Nil && CFWriteStreamOpen (myWriteStream)==true && CFReadStreamOpen (myReadStream)==true){
CFIndex result = CFWriteStreamWrite ( myWriteStream, (UInt8*)&buffer, sizeof(buffer));
}
Friends please help me if you know how to avoid blocking.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden