How can I increase the maximum number of requests that an RMI server can handle simultaneously. I am getting connection refused error after 25 request are made simultaneously from 25 threads in a client.

Edward Harned

Without knowing more of the details, you may be running into a temporary condition, (like a packet storm), where the receiver is overloaded. We use a retry loop for connection errors.

// try to connect this many times
int count = 10;

// keep trying the connection
while (count > 0) {
    try {
        ourRO = (OurRemoteObject)java.rmi.Naming.lookup(our_name);
        // got one
        return;
    }

    catch(ConnectException e) {
        count--;
    }
    catch(Exception e) {
        // add your code here
        break;
    }
}

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact