Article View: borland.public.jbuilder.java.api
Article #577Re: Sockets and Client/Server applications
From: Alan Shiers
Date: Fri, 13 Jun 2003 21:12
Date: Fri, 13 Jun 2003 21:12
24 lines
2399 bytes
2399 bytes
Kevin Dean wrote: > There is nothing preventing you from changing the data format to a byte >stream for raw binary data and then switching it back again. > You know, initially I tried this approach but began to have problems. Originally I had only one ServerSocket and using only DataInputStream and DataOutputStream classes on the connection. As we know, you use the getInputStream() and getOutputStream() methods of the ServerSocket object to connect with the stream classes just mentioned. However, when I called a method that is designed specifically to download a file whereby I switched to BufferedInputSteam and used the getInputSteam() method of the ServerSocket object to connect, I then seemed to have lost my connection with the DataInputStream and DataOutputStream objects because when I began to use them, after returning from the download method, I started getting Exceptions. I thought that calling getInputStream() on the ServerSocket object in the download method was disconnecting the DataInputStream object, and I can't have that! When returning from the download method should I have called the getInputStream() method again for the DataInputStream object to re-establish the connection? Alan
Technical Details
Message-ID:
<3EEA3E3C.6CC52E79@hfx.eastlink.ca>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3EE34D95.E0767B34@hfx.eastlink.ca> <3ee4a9df$1@newsgroups.borland.com> <3EE4B19A.D1A9BF4@hfx.eastlink.ca> <3ee95418$1@newsgroups.borland.com> <3EEA1B0B.F96AB3D@hfx.eastlink.ca> <3eea30b2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,21183e92a0cd9ddc X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-06-13 14:15:53 PST Message-ID: <3EEA3E3C.6CC52E79@hfx.eastlink.ca> Date: Fri, 13 Jun 2003 18:12:28 -0300 From: Alan Shiers <ashiers@hfx.eastlink.ca> X-Mailer: Mozilla 4.78 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api Subject: Re: Sockets and Client/Server applications References: <3EE34D95.E0767B34@hfx.eastlink.ca> <3ee4a9df$1@newsgroups.borland.com> <3EE4B19A.D1A9BF4@hfx.eastlink.ca> <3ee95418$1@newsgroups.borland.com> <3EEA1B0B.F96AB3D@hfx.eastlink.ca> <3eea30b2$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.222.101.2 X-Trace: newsgroups.borland.com 1055538833 24.222.101.2 (13 Jun 2003 14:13:53 -0700) Lines: 24 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail