سؤال

I need to implement a TCP server with a web interface included for management.

Basically, the tcp server will be listening to new connections and keeping current ones active while the web interface allow me to see information regarding these connections and to interact with them (e.g. send messages and seeing received ones)...

My concerns resides in the "TCP Server" integration with the web application. For received messages I could simple use a shared DB, but I need to send messages to the peers connected into the TCP server.

My best bet is currently on JCA. Some research pointed me to a nice sample: http://code.google.com/p/jca-sockets. The sample uses an Message Driven Bean to deal with messages received over port 9000, acting as an echo server.

I am new in the Java EE 6 world. I trying to figure out why things were done in one way or another in the sample (e.g. why MDB?).

JCA has a fairly complicated spec. So I am trying at first to adapt the sample above to keep the connections active to exchange data. My next step will be adapt it to accept a string over a servlet to forward it to a given peer.

Can someone help me out on this?

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top