Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java ServerSocket Problems

 
Suhail Asif
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Regards
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could run the server in its own thread within the application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic