• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Disposing of streams from within their callback?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Disposing of streams from within their callback?
      • From: Becky Willrich <email@hidden>
  • Prev by Date: Jaguar and PPPLIB
  • Next by Date: Re: Disposing of streams from within their callback?
  • Previous by thread: Re: Jaguar and PPPLIB
  • Next by thread: Re: Disposing of streams from within their callback?
  • Index(es):
    • Date
    • Thread