A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
this week in the
Sockets and Internet Protocols
Doubt in ServerSocket and Socket
Joined: Sep 25, 2007
Dec 05, 2008 02:30:00
what is the difference between the the Socket object created by client side as
Socket socketClient = new Socket("localhost",4444);
and the Socket object created in the Server side as
ServerSocket serverSocket = new ServerSocket(4444); socket socketServ = serverSocket.accept();
Next, should I use the sockets reversely ?
SCJP 5.0 | SCWCD 1.5
Joined: Oct 27, 2005
Dec 05, 2008 03:23:00
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
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: Doubt in ServerSocket and Socket
applet loading forever...
Objects to capture!!
Client Server Communication
sockets and printwriting
not able to connect...
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014