🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #926

Re: OutOfMemoryError

#926
From: Owen Green
Date: Fri, 05 Jul 2002 16:11
33 lines
2674 bytes
"Alan Shiers" <ashiers@hfx.eastlink.ca> wrote in message
news:3D25C73F.4D8D94E0@hfx.eastlink.ca...

>
> As mentioned earlier, the way the scenario goes on the client side is:
>
> 1)in uploadFile() create a File object
> 2)get the files size and transmit that value to the server app
> 3)the server app determines if there is enough space in the users home
> directory
>   to accomodate the file.
> 4)I need a mechanism on the client side to wait for the reply from the
> server
>   as to whether to proceed or not, thus the request_workerThread. It
> will wait
>   five second intervals, up to 30 seconds total for a reply. After 30
> seconds, if there
>   is no reply from the server, request_workerThread suspends itself
> again
>   until it is called.
A call to read() on the input stream will block until it has data, and by
using the socket timeout, will handle that aspect as well. If you are to
process you could then either create a new thread or using a thread pool of
some sort, giving it the File reference and let it get on with the upload in
the background.

I would still be tempted to have the client and server establish a secondary
socket for the data transfer though; that makes it much easier to code for
situations like stopping the transfer gracefully, allowing for resumes etc.

hope I've got the right end of the stick,
Owen
Technical Details
Message-ID: <3d25c545_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-08!supernews.com!news-out.visi.com!hermes.visi.com!eusc.inter.net!fu-berlin.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews
References: <3D20CC5D.B70473C9@hfx.eastlink.ca> <MPG.178acb912dba8f7998b79d@newsgroups.borland.com> <3D21C1CA.F2D953E2@hfx.eastlink.ca> <3d21bb44_1@dnews> <3D21EC78.228A5CD3@hfx.eastlink.ca> <3d21e07b_2@dnews> <3D226288.1C7C905@hfx.eastlink.ca> <3d22ec28_1@dnews> <3D233ADD.C365148D@hfx.eastlink.ca> <3d245dff_2@dnews> <3D24D4AC.1B1BFBBC@hfx.eastlink.ca> <3d24db4d_2@dnews> <3D25C73F.4D8D94E0@hfx.eastlink.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,28eab50e784856ac
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-07-05 09:36:06 PST
From: "Owen Green" <owen@begonefoulmachine.kennulz.demon.co.uk>
Newsgroups: borland.public.jbuilder.java.api
References: <3D20CC5D.B70473C9@hfx.eastlink.ca> <MPG.178acb912dba8f7998b79d@newsgroups.borland.com> <3D21C1CA.F2D953E2@hfx.eastlink.ca> <3d21bb44_1@dnews> <3D21EC78.228A5CD3@hfx.eastlink.ca> <3d21e07b_2@dnews> <3D226288.1C7C905@hfx.eastlink.ca> <3d22ec28_1@dnews> <3D233ADD.C365148D@hfx.eastlink.ca> <3d245dff_2@dnews> <3D24D4AC.1B1BFBBC@hfx.eastlink.ca> <3d24db4d_2@dnews> <3D25C73F.4D8D94E0@hfx.eastlink.ca>
Subject: Re: OutOfMemoryError
Date: Fri, 5 Jul 2002 17:11:45 +0100
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 193.237.54.9
Message-ID: <3d25c545_1@dnews>
X-Trace: dnews 1025885509 193.237.54.9 (5 Jul 2002 09:11:49 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-08!supernews.com!news-out.visi.com!hermes.visi.com!eusc.inter.net!fu-berlin.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews