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

Java ServerSocket Problems

Suhail Asif

Joined: Sep 29, 2011
Posts: 3
I am designing a java server using java's ServerSocket class. The issue is that i have to run a infinite loop to handle all the incoming requests. Now i also intent to a lot of other things in that application. Is there a way to run the server to hear the requests and then do other tasks also such as giving response to other things happening to application.

To explain a little more the application is a server as well as a data management program. User enters the data and it is needed to be saved. But if the application keep stuck in waiting for the serversockets it can not process the data.

Any help will be much appreciated.

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
You could run the server in its own thread within the application.
I agree. Here's the link:
subject: Java ServerSocket Problems
jQuery in Action, 3rd edition