Article View: borland.public.jbuilder.java.api
Article #929Re: OutOfMemoryError
From: Alan Shiers
Date: Fri, 05 Jul 2002 22:12
Date: Fri, 05 Jul 2002 22:12
57 lines
3619 bytes
3619 bytes
Hi Owen, For now, I'm looking for a solution regarding the while loop in the receiveFile() method on the server app. Shall we solve that problem first? I need some way of making it exit the loop. Somehow it has to get that EOF signal. Your idea for creating a whole new socket for uploading and downloading of files is a good one. I hadn't thought of that. Perhaps the next version release I'll delve into implementing that idea. One other thought did cross my mind, this particular posting to the newsgroup is getting rather lengthy and the subject matter has had its twists and turns from the original posting. Should we continue our conversation away from the newsgroup? Or do you want to continue as is? I'm easy either way. I'm just not sure others would find what we have to say from this point on of any interest. Alan Owen Green wrote: > > "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:
<3D2619EB.4E07BAF3@hfx.eastlink.ca>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!hermes.visi.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<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> <3d25c545_1@dnews>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 14:33:56 PST Message-ID: <3D2619EB.4E07BAF3@hfx.eastlink.ca> Date: Fri, 05 Jul 2002 18:12:59 -0400 From: Alan Shiers <ashiers@hfx.eastlink.ca> Organization: Mustard Seed Software X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: OutOfMemoryError 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> <3d25c545_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.222.101.2 X-Trace: dnews 1025903424 24.222.101.2 (5 Jul 2002 14:10:24 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!hermes.visi.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews