Hi,
Just awt event processing like.
there are
1,don't share IoSession self in multiple thread. If there are some stuff
need shared, just create other state object by yourself, IoSession should
not and not know your state.
2, even if mina to do it with queue support, nor use it. Your protocol must
assure some order of command.
3, I guess if you want Full Duplex works, but you must assure command
orders. As I known, there are few protocol works in network in tcp. udp
works for it. If tcp, you can check out jira with a ftp client provide
multiple IoSession community local.

Regards

2007/7/13, Stefano Antonelli <[EMAIL PROTECTED]>:

 Hi All,

I want to write a multi threaded client protocol using Mina but I am
having some problem.

I did the fallowing:
- I wrote a ProtocolDecoded/ProtocolEncoder ant tested it carefully
- The protocol is TCP
- The usage scenario is:

   1. I configure a Connector to use the Encoder/Decoder
    2. I connect it and get The IoSession
   3. I share the IoSession between some threads. Each thread calls
   session.write, that means taht the IoSession is accessed
   concurrently.
   4. I also wrote an IoHandler class in order to process the answer
   from the server

The problem is that it is working ok with just one thread but it is
failing to send some message in a multi threaded scenario.
I checked my code and it seems ok.
Am I doing something wrong with Mina? Is it ok to concurrently access the
IoSession  from different threads?

Thank you all

Stefano




--
向秦贤

Reply via email to