realbasic-nug
[Top] [All Lists]

Re: Socket Taking Over. Need a Thread?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Socket Taking Over. Need a Thread?
From: Christopher Jett <lists at jettfuel dot net>
Date: Sat, 29 Dec 2007 23:02:57 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <000801c84a9b$5fe63d90$6401a8c0 at MikeBrHP>
On Dec 29, 2007, at 10:20 PM, RBNUBE wrote:

>> Yeah - I'm just not sure how to handle that...
>
> I've never done exactly what you're doing, so I'm not sure that I  
> do either.
> See my assumptions below...
>
>
>> 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.
>
> I would assume that you would simply move your code to the thread  
> Run event
> and then call MyThread.Run from inside the DataAvailable event.
>
> If you don't know how to use a thread, it's very simple.  Just drag  
> a thread
> into the window from the Control List.  Once you've done that, you can
> access its Run event by double-clicking it.  You might have to  
> adjust the
> thread Priority to suit your needs.  I usually set the Priority to  
> 1.  I
> haven't noticed any ill effects from doing this.

I haven't adjusted the thread priority, but everything else you  
mentioned I have done.  The results are the same - the socket does  
not yield time to the rest of the application when a file is uploaded.

FYI - this is an HTTP server for several applications.  It will have  
the ability to upload files via web forms.  That part works and I am  
able to parse the multipart form data to retrieve the POST variables  
and the file data.  The problem seems to be that the socket locks up  
the application while it is receiving a file until the whole file is  
received.
--
Chris
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>