On Dec 30, 2007, at 7:14 AM, Theodore H. Smith wrote:
>> To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
>> Message-ID: <33A8632C-4B8C-44BD-8DBB-2890C1CE61AA at jettfuel dot net>
>>
>> I am working on an HTTP server that will be incorporated into several
>> projects. In testing, I have an HTML page with a form that allows
>> upload of a file. Everything is working fine, but the application
>> becomes unresponsive when uploading a file of any size. I have in
>> the DataAvailable event code that reads what's in the socket buffer
>> and adding it to an string that is acting as a buffer. Is there a
>> better way to implement things so that the application remains
>> responsive and other connections can continue to operate? Should I
>> try using a Thread to handle reading the data and remove the code
>> from the DataAvailable event?
>
> Set .YieldsToThreads to true.
>
> Or maybe it's called .YieldsToSomethingElse
>
> Or .YieldsWhatever
>
> I dunno what it's called. But I think it starts with .Yields :)
>
> Anyhow, that's exactly what you are looking for. My sockets don't
> leave my apps unresponsive. I even have progress bars in the app which
> let the user know how it's going while he goes off and does other
> things in the app.
The socket is a subclassed TCPSocket that is handling incoming
requests from a browser. It is during a large incoming request (i.e.
a large file upload from an HTML form) that the app becomes
unresponsive while the socket is receiving the large amount of data.
I don't see any .Yields anything for a TCPSocket.
--
Chris Jett
chris at jettfuel dot net
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|