• 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
Re: CFNetwork crash!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: CFNetwork crash!
      • From: Avi Drissman <email@hidden>
References: 
 >Re: CFNetwork crash! (From: Avi Drissman <email@hidden>)

  • Prev by Date: Re: local host IP address on X
  • Next by Date: Re: local host IP address on X
  • Previous by thread: Re: CFNetwork crash!
  • Next by thread: Re: CFNetwork crash!
  • Index(es):
    • Date
    • Thread