• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chat Client and file transfer

 
Soumyadeep Ganguly
Greenhorn
Posts: 7
  • 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: 20659
64
Chrome Eclipse IDE Java Windows
  • 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
  • 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
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. An ObjectOutputStream is meant for sending Java objects, not files.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic