aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Chat Client and file transfer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Chat Client and file transfer" Watch "Chat Client and file transfer" New topic
Author

Chat Client and file transfer

Soumyadeep Ganguly
Greenhorn

Joined: Mar 01, 2010
Posts: 7
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?


Soumyadeep
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
joe vasher
Ranch Hand

Joined: Nov 06, 2009
Posts: 37
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

No. An ObjectOutputStream is meant for sending Java objects, not files.
 
 
subject: Chat Client and file transfer