Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending data with CFSocket




On Jun 28, 2005, at 6:13 AM, Tomas Franzén wrote:

I'm using CFSocket to connect/listen for connections and it works pretty great.
But I do have a problem sending data. If I call CFSocketSendData several times (in a row, basically), it often seems like some data gets truncated. Is this because CFSocket doesn't have enough time to send data before I send some more?


I tried 'subscribing' to the kCFSocketWriteCallBack callback, and ran a run loop with a timer checking if that callback had been called, and if so, stop the loop. But the callback never fired until the main app loop ran (I'm writing a plug-in so I don't have control over the main app).

What's the best way to solve this? Can I somehow wait for CFSocket to finish sending before continuing?


Probably the easiest thing is to use CFStream et al., which handle this for you.


Douglas Davidson

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden
References: 
 >Sending data with CFSocket (From: Tomas Franzén <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.