File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Doubt in ServerSocket and Socket 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 "Doubt in ServerSocket and Socket " Watch "Doubt in ServerSocket and Socket " New topic
Author

Doubt in ServerSocket and Socket

Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
hi,

what is the difference between the the Socket object created by client side as



and the Socket object created in the Server side as


Next, should I use the sockets reversely ?


Abhijit Das
SCJP 5.0 | SCWCD 1.5
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

A socket has two end points - one on the client and one on the server, even if the client and server are on the same physical machine.

The first call creates the end point on the client side. ServerSocket.accept returns the end point on the server side. They are two different objects, but linked through the network.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in ServerSocket and Socket