File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "socket" Watch "socket" New topic


Sarada Bhasker
Ranch Hand

Joined: Sep 11, 2000
Posts: 94
Can my servlet have a serversocket in that?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
A ServerSocket in a servlet class would not be a good idea since the Thread executing the accept() method would just sit there. You can certainly have a servlet communicate with another Java program that is running a ServerSocket.
Sarada Bhasker
Ranch Hand

Joined: Sep 11, 2000
Posts: 94
Thanks for your reply. How can I make the servlet communicate with program running serversocket? Can you show an eg? Do I need to have a socket connection for the servlet and pipe it to client?
Thanks in advance

[This message has been edited by Sarada Bhasker (edited November 27, 2000).]
I agree. Here's the link:
subject: socket
jQuery in Action, 3rd edition