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: Thu, 19 Jun 2008 10:30:39 +0530
Hi,
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.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden