I happen to have an AOLerver application that writes a lot of data (in text form) out to the client. Now, this data can be computationally intensive and take quite a while to generate, and there can be pauses during the generation. Also, the client wants the data in a timely fashion, and is able can start using the data before it gets all of it. So, I definitely don't want to just wait to generate all the data, then finally write the whole big batch out once at the end.
At the moment, I use ns_write to periodically push data out, and I'm ns_writing it out at whatever point it was convenient to do so in the code, not in any optimized fashion. Currently the server and client are on the same local ethernet, so this works just fine. However, I was wondering what the proper way to handle this sort of thing would be if the server and client had to talk to each other over a much slower network link. In that case, I think I should ideally write out data only when I either have a full tcp/ip packet's worth of data to send, or some application determined "too long" amount of time has passed, or, of course, when I'm sending the final packet of data. Correct? I think that's the right strategy, however, I'm not at all clear on the proper way to accomplish it. Does AOLserver have Tcl APIs that I could/should use for that? Or C APIs? Or would I have to code some C code myself, and if so, is there a clear explanation of how to go about it which you could point me to? Also, is it true that ns_write ALWAYS blocks until the data actually reaches the client? Or does it only block until the local tcp/ip stack sucks the data into its buffer? I think the later, but that could effectively be just as long as it takes the data to get all the way to the client? Or, well, just exactly what are all the network performance ramifications here? In AOLserver ns_write, ns_return, etc. all ultimately come down to Ns_SockSend calling send() to write data to the socket, but, well, that itself never seemed enough for me to answer all the questions above for myself... -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com I. To remove yourself from this list: Send a message to "[EMAIL PROTECTED]" with the following text in the BODY of your message: signoff aolserver II. For a complete list of listserv options please visit: http://listserv.aol.com/ III. For more AOLserver information please visit: http://www.aolserver.com/
