servlet for implementing socket connection

前端 未结 3 1386
失恋的感觉
失恋的感觉 2020-12-19 18:25

How do I implement a web application with a Servlet that is listening on a port for socket connections?

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 19:01

    I assume you don't mean the front-door HTTP connection, which you get for free with the servlet container... But if you want to add, say, an admin service you could create a listener thread that sets some global state in the servlet. Note that this is not considered kosher (and I believe may even violate the servlet standard).

提交回复
热议问题