Re: CFNetwork crash!
Re: CFNetwork crash!
- Subject: Re: CFNetwork crash!
- From: Jeremy Wyld <email@hidden>
- Date: Tue, 16 Jul 2002 15:06:38 -0700
On Tuesday, July 16, 2002, at 12:55 PM, Avi Drissman wrote:
To kill a stream pair:
-----
CFReadStreamSetClient(otEndpointPtr->readStream, 0, nil, nil);
CFReadStreamUnscheduleFromRunLoop(otEndpointPtr->readStream,
gMainRunLoop, kCFRunLoopCommonModes);
CFReadStreamClose(otEndpointPtr->readStream);
CFRelease(otEndpointPtr->readStream);
otEndpointPtr->readStream = nil;
CFWriteStreamSetClient(otEndpointPtr->writeStream, 0, nil, nil);
CFWriteStreamUnscheduleFromRunLoop(otEndpointPtr->writeStream,
gMainRunLoop, kCFRunLoopCommonModes);
CFWriteStreamClose(otEndpointPtr->writeStream);
CFRelease(otEndpointPtr->writeStream);
otEndpointPtr->writeStream = nil;
-----
Under Puma, the client is also responsible for closing the native
socket if they created the streams from a native socket.
Just before the call to close the stream, you should call
CFReadStreamCopyProperty or CFWriteStreamCopyProperty with the key set
to kCFStreamPropertySocketNativeHandle. After closing the streams,
call close() with the native socket.
jeremy
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.