Hi,

 

I'm using for standard client/server application since a couple of months
but now I'm facing a problem I don't understand how to solve.

I need to write a server, using mina 1.1.x, which listen for a single client
connection. The client sent requests (XML over TCP), server receives and
processes these requests in its threads, write an ACK back to the client and
pass results to application logic.

The application, acting on results, needs to send messages back to the
client using the same session but from its own threads.

In this scenario I see a thread concurrency problem since when application
decides to send back message to client it's possible that client sent
something and server is using the session. Maybe I'm missing something ... 

 

How can I solve this kind of problem?

What kind of thread configuration do you suggest to use remembering I've a
single client connected to the server?

 

I suppose I can share (can I?) session between threads but I've to lock
session.write(...) compromising performances ...

 

Any comment will be very useful,

 

Thanks

 

Stefano

Reply via email to