This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 42959
You could run the server in its own thread within the application.
I agree. Here's the link:
subject: Java ServerSocket Problems
It's not a secret anymore!