my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java ServerSocket Problems" Watch "Java ServerSocket Problems" New topic
Author

Java ServerSocket Problems

Suhail Asif
Greenhorn

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.

Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
You could run the server in its own thread within the application.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java ServerSocket Problems
 
Similar Threads
Doubt in Sockets!!
Urgent Help required
question regarding server socket if server socket is other machine
Related to ServerSocket
Sending HTML pages to client