Java server for a J2ME application
I'm trying to write a server on Java
for polling and managing some hardware with GPRS
- modems on J2ME
. Now I have implemented a site for displaying information on Spring MVC
and added it to TomCat
.
Stuck on implementing a long connection with clients in separate threads to exchange data (there will be up to 100 clients). I can't find a sensible example for my case using Spring
and Tomcat
(all examples for creating websites), the concept is basically similar, but everything I can't give her the same fret. Tell me which way to think, or maybe I did not choose the right technology to implement this task at all?
1 answers
Spring MVC is a web framework, so it is designed to work with the http protocol, and the http protocol is not designed to hold a connection for a long time, it works in request-response mode. Data exchange at the tcp socket level is more suitable for you. If there are a lot of connections, it is better to use asynchronous sockets. Look towards Netty.