ServerSocket(TCP/IP) listening in the web container part

So, if I implement the ServerSocket(TCP/IP) listening in the web container part (Websphere), what is the best way to do this?

I need to monitor socket state and statistics from browser.

When I receive message from socket, I must read something from database and send as response to client (meaning I need to create my own thread to do this).

Solution:

- to have one servlet with serverSoket listener in it or

- during web application statup to start my own thread with serverSoket listener

- or....

Also there is a problem that websphere write warning when i try do use DB connection from thread I have created!

Any suggestion?

[683 byte] By [djuzorana] at [2007-10-2 17:51:34]
# 1
hi;i'd use a servlet for that issue. i dont know why a db warning comes. can you detail it http://asahin.net
A_SAHINa at 2007-7-13 19:09:54 > top of Java-index,Archived Forums,Socket Programming...
# 2

hi,

do you use websphere? version?

More details:

http://www.javaranch.com/newsletter/200403/AsynchronousProcessingFromServlets.html

According to a Technical note from WebSphere support "If a Servlet is spinning its own threads and accessing a database, the J2EE specification is not clear on this, so WebSphere Application Server 5.0 will allow it at this time. IBM is working with Sun to clarify this in the specification, so eventually (i.e. J2EE 1.4) spun threads from a Servlet accessing a database outside of a transaction will not be supported either". Later the same tech note states "Customers should consider changing their application to comply with the J2EE specification."

and check this

http://www-1.ibm.com/support/docview.wss?uid=swg21121449

djuzorana at 2007-7-13 19:09:54 > top of Java-index,Archived Forums,Socket Programming...
# 3
Anybody?
djuzorana at 2007-7-13 19:09:54 > top of Java-index,Archived Forums,Socket Programming...