Disposing of streams from within their callback?
Disposing of streams from within their callback?
- Subject: Disposing of streams from within their callback?
- From: Avi Drissman <email@hidden>
- Date: Mon, 28 Oct 2002 16:06:05 -0500
A quick question. I use CFStreams in my server. When someone logs
out, I dispose of the endpoints like this:
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;
Is it safe to do that from within a callback to the read stream
(kCFStreamEventHasBytesAvailable, kCFStreamEventErrorOccurred or
kCFStreamEventEndEncountered)?
Avi
--
Avi 'rlwimi' Drissman
email@hidden
Argh! This darn mail server is trunca
_______________________________________________
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.