This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Servlet and Socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet and Socket" Watch "Servlet and Socket" New topic
Author

Servlet and Socket

Niral Trivedi
Ranch Hand

Joined: Nov 26, 2001
Posts: 46
Hi All,
I have one java server running on a machine. And I have servlet running on another machine. I want to talk to the java server from the servlet using socket.
Any special thing I have to be aware of? Any good site/tutorial/info available onilne?
Thanks in advance
Dani Mazzuca
Ranch Hand

Joined: May 21, 2003
Posts: 70
Hi,
no, no problems, just do it like any other Socket connection. The servlet can open a Socket() connection with your other Java-Server. The last one should create a ServlerSocket() object and accept() requests from your servlet.

Dani
 
 
subject: Servlet and Socket