|
From: | Andreas Höschler |
Subject: | Re: writeData: does not send out data for 5-10 minutes |
Date: | Tue, 20 Sep 2005 14:12:29 +0200 |
Hello Richard,
being called on the server end. This basically works. However, sometimes it takes 5 or more minutes before the data is received by the server. I assume that since I only sent a few bytes only and the data is kept until either more data is queued for transmission or a timeout occurs before the data is actually sent over the line. Can anybody confirm this assumption? What can i do about it? What I am looking for is some kind of flush mechanism (in NSFileHandle or directly on the socket) that sends out the data immediately regardless of how small the package is.The assumption is (at least as far as the base library is concerned) wrong ... -writeData: sends the data immediately, no matter how small the amount.
Thanks for the info.
That being said, it's possible that your underlying network stack is not sending the data. Seems unlikely though.Perhaps you aren't running the runloop? The runloop does neeed to be run in order to receive data asynchronously.
That's not it. Of course I have a run loop. The weird thing is, this works in 9 cases, and in one case it hangs for a while (a few minutes) before I get a response. I don't know exactly whether it hangs on the sending or the receiving side. Now that you say, data is sent immediately, I guess it is the fault of NSFileHandle-readDataInBackground on the receiver side (waiting for more data or a timeout or whatever). Note, I encounter this on Solaris. This is no show-stopper for me, it's just a liitle weird (annoying).
Regards, Andreas
[Prev in Thread] | Current Thread | [Next in Thread] |