Are you logging messageSent events on your IoHandler? I.e, do you know for
sure your messages are actually getting sent from the client?
You also shouldn't have to synchronize on your IoSession every time you
send. I can't think of anything negative it would cause right now, but what
are you trying to achieve by synchronizing there?
-Adam
On 8/3/07, Pradheep <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I'm facing an issue when the multiple threads are accessing the session
> (IOSession) concurrently.
>
> ISSUE
> When the client is invoked with multiple threads, the client keeps sending
> the requests to but the packets never reach the server. at one point of
> time
> all the threads are waiting for the resposne ie the client is completely
> blocked.
>
> But when a new client connects to it, it works fine, but the previous
> client
> simply waits for response
> (the server prints each request it receives)
>
> Question Are there any such known issues on MINA or is it problem with the
> way the code operates (pseudo code is given below).
>
>
> --------------------------------------------------------------------------------------------------------------------------
> void sendAndWaitForResponse() {
> synchronized(iosession) {
> Response responseMessage = new Respons();
> iosession.write(message); // write the bytes in to session
> map.put(requestID,response) //store the response object in a MAP
> -
> with an id
> responseMessage.wait();
> }
> }
>
> void responseReceived(Response receivedResposne) {
>
> Response lockedResponse = map.get(receivedResposne.getID());
> lockedResponse.notify();
> }
>
> --------------------------------------------------------------------------------------------------------------------------
>
> Note - It is very much sure that ID generation produces unique key.
>
> Thanks in advance,
> Let me know if you need more information.
>
> regards,
> Pradheep.
> --
> View this message in context:
> http://www.nabble.com/An-issue-with-multiple-threads.....-tf4213557s16868.html#a11986762
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com
> .
>