File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41020
    
  43
You could run the server in its own thread within the application.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java ServerSocket Problems
 
Similar Threads
Urgent Help required
question regarding server socket if server socket is other machine
Related to ServerSocket
Sending HTML pages to client
Doubt in Sockets!!