This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chat Client and file transfer

 
Soumyadeep Ganguly
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am studying HFJ now and i have some questions.
On page 519and 520 there are two programs on SimpleChatClient and VerySimpleChatServer. My question is chat-client and file transfer programs are different, right?bt the same concept of server client are used? and can i transfer file without ftp or http?
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soumyadeep Ganguly wrote:My question is chat-client and file transfer programs are different, right?

I don't know these two classes, but my guess is the only difference is in the actual data that is sent between the two. Unless you're talking about peer-to-peer file transfers, there's also a client-server model there.

and can i transfer file without ftp or http?

Sure. All you need to do is transfer the data from one machine to another. FTP and HTTP are only two protocols for that. Windows file sharing (a.k.a. SMB) is another protocol that can be used for this, as is NFS (for Linux / Unix). Implementing your own using direct Socket / ServerSocket pairs is also possible.
 
joe vasher
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the above, can you just use outputObjectStream and send the jar file as an object. Of course put in a bufferedstream read and write, correct?
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. An ObjectOutputStream is meant for sending Java objects, not files.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic