🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Transfer files

#2177
From: John McGrath TeamB
Date: Thu, 10 May 2001 08:28
32 lines
2276 bytes
On Wed, 9 May 2001 10:48:02 -0700, M Hamedi wrote:

> I just used Socket for the client and ServerSocket for the
> server, had the server listen on a port number.

In order to read the contents of a file on another machine, you need
to have some software running on the other machine that implements a 
protocol that can be used to transfer the file.  There is nothing 
inherent in a TCP socket connection that will do this for you.

You can certainly use a socket to transfer the data.  The client would 
write a message to the socket requesting the file, and then the server 
would write the file contents to the socket.  The client would have to 
read those bytes from the socket and then do what it wants with them.

Marcel mentioned RMI, which is a much higher level protocol than TCP 
sockets.  With this protocol, you transfer Java objects rather than 
just bytes.  There are many other protocols that you might use.  FTP 
and HTTP, for example, are very well suited for transferring files.

Without knowing more about your application and the systems that it 
will run on, it is not possible to suggest which protocol would be 
appropriate.  It you tell us more, then maybe we can offer some advice.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.1563e33f5fdeb4c298a1b9@forums.borland.com>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3af88ef1_2@dnews> <MPG.1562bf651cf34b2098a1b4@forums.borland.com> <3af98239_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,7f1c8fc909561cee
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-05-10 02:04:02 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: Transfer files
Date: Thu, 10 May 2001 04:28:52 -0400
Message-ID: <MPG.1563e33f5fdeb4c298a1b9@forums.borland.com>
References: <3af88ef1_2@dnews> <MPG.1562bf651cf34b2098a1b4@forums.borland.com> <3af98239_1@dnews>
X-Newsreader: MicroPlanet Gravity v2.30
NNTP-Posting-Host: 209.92.40.60
X-Trace: dnews 989483333 209.92.40.60 (10 May 2001 01:28:53 -0700)
Lines: 32
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!fr.usenet-edu.net!usenet-edu.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews