mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pradheep <PRADHEE...@GMAIL.COM>
Subject An issue with multiple threads..... - Reposted due to formatting issues
Date Fri, 03 Aug 2007 16:40:26 GMT

Hi,

I'm facing an issue when the multiple threads are accessing the session
(IOSession) concurrently. <br>

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.....---Reposted-due-to-formatting-issues-tf4213558s16868.html#a11986763
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Mime
View raw message