Is there anything, what can block me using the java.net.ServerSockets on the Tomcat server? As i understand it, the Tomcat is used mainly for http based communication servlet, but raw sockets can be used as well, right?
Regards,
STeN
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are referring to inside the scope of a Servlet then that’s definitely asking for trouble. Threads in Tomcat are recycled and this will basically block other requests from using your thread (at least until your thread’s request times out). You can, of course create a new thread and bind it to a port (if your Tomcat user has permissions) outside of the request/response cycle but you may want to look into creating a custom Tomcat connector instead.