Hi
I have a question and here are my requirements
Client <-> Server A <-> Server B
I'd like to implement client socket on server A to comunicate with server B.
First the request is triggered by client and Server A retrieve the request
msg from Client do some processing and send a request to Server B to process
another logic, in the meanwhile Server B 's going to send response back to
Server A and Server A will do some processing again before pass the response
back to Client.
the requirement on the connection between Server A and Server B is allowed
only one persistent socket connection on Server B, so that's mean Server A
must create and use only one socket connection in order to communicate with
Server B. But the problem is I have many many Clients which every single
Client's gonna send the different msg to Server A and B, if I create 30
threads to be listeners for Client on Server A and in order to send the
requests to Server B by using just only one object of socket connection.
some threads in Server A may get the wrong response from Server B. but if i
implement synchronized block on Server A like this
synchronized(socketConnectionObject) {
write -> to Server B
read -> from Server B
}
if I have 100 Clients in the same time, the Client #100 must wait till
Client #1-#99 completed everything, This is not async.
But if i use NIO , How to implement just only one socket connection on
Server A so that this object can be used by those 30 threads in Async.
How can i use MINA to solve this problem? Please kindly advise
Thank you
--
View this message in context:
http://www.nabble.com/Client-socket---Multi-thread-with-only-one-socket-connection-tp15038293s16868p15038293.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.