How to configure java server based on sockets (non http ) with Tomcat
I'm currently developing a web server based on sockets for a web game.
The client will be based on Java applet.Is it possible to use Apache Tomcat server for this mission?
If it is possible, could you recommend us a step by step guide for how to configure it?
Do y开发者_Python百科ou think that we should use alternative server for that?
Will it be easier to implement this using servlets (http requests) and Google Application Engine?
I think you have to write your own connector and protocol handler for tomcat if you need another protocol than http.
In this case try Apache Mina.
I don't know anything about Servlets and Tomcat, but you can simply start the server as a standalone Java program, opening a ServerSocket to listen on the port. On each connection, split off a new Thread with will read from the new Connection.
For greater scalability, use nonblocking IO and a selector instead of a separate thread for each connection.
精彩评论