You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Stanislav Miklik <st...@gmail.com> on 2006/07/31 16:17:46 UTC
Bug in xmlrpc-3.0b1
Hello,
I think I found bug in xmlrpc-3.0b1. Maybe it is corrected now, but also in
rc1 it was the same. I can't find the way to report this bug, also I write
email to you.
Bug - more correctly:
class: org.apache.xmlrpc.webserver.WebServer
method *
private
**synchronized* *void* setupServerSocket( *int* backlog) *throws*IOException
*{*
// Since we can't reliably set SO_REUSEADDR until JDK 1.4 is
// the standard, try to (re-)open the server socket several
// times. Some OSes (Linux and Solaris, for example), hold on
// to listener sockets for a brief period of time for security
// reasons before relinquishing their hold.
*for* (*int* i = 1; ; i++) {
*try* {
serverSocket = createServerSocket(port, backlog, address);
// A socket timeout must be set.
*if* (serverSocket.getSoTimeout() <= 0) {
serverSocket.setSoTimeout(4096);
}
*return*;
}
*catch* (BindException e) {
*if* (i == 10) {
*throw* e;
}
*else* {
*long* waitUntil = System.currentTimeMillis();
*for* (;;) {
*long* l = waitUntil - System.currentTimeMillis();
*if* (l > 0) {
*try* {
Thread.sleep(l);
}
*catch* (InterruptedException ex) {
}
}
}
}
}
}
}
Selected text seems to me like neverending cycle. I don't see the way out
and also variable l is always l<=0.
Bye, hopefully it is not problem to correct it.
Stano.
Re: Bug in xmlrpc-3.0b1
Posted by Jochen Wiedmann <jo...@gmail.com>.
On 8/2/06, Stanislav Miklik <st...@gmail.com> wrote:
> Current code is:
> } *catch* (BindException e) {
> * if* (i == 10) {
> * throw* e;
Throwing the exception here will leave the circle.
Jochen
--
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
Re: Bug in xmlrpc-3.0b1
Posted by Stanislav Miklik <st...@gmail.com>.
Current code is:
} *catch* (BindException e) {
* if* (i == 10) {
* throw* e;
} *else* {
* long* waitUntil = System.currentTimeMillis() + 1000;
* for* (;;) {
* long* l = waitUntil - System.currentTimeMillis();
* if* (l > 0) {
* try* {
Thread.sleep(l);
} *catch* (InterruptedException ex) {
}
}
Pls, can you describe me how will end this for(;;) cycle?
Shouldn't ne there something like
if(l>0){
//wait
} else break;
Bye
Stano
On 8/1/06, Jochen Wiedmann <jo...@gmail.com> wrote:
>
> Stanislav Miklik wrote:
>
> > Selected text seems to me like neverending cycle. I don't see the way
> out
> > and also variable l is always l<=0.
>
> You are right for the l<=0. Fixed.
>
> As for the neverending cycle, I can't follow you:
>
> for (int i = 1; ; i++) {
> ...
> if (i == 10) {
> throw e;
> }
> }
>
>
> Jochen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
>
>
Re: Bug in xmlrpc-3.0b1
Posted by Jochen Wiedmann <jo...@gmail.com>.
Stanislav Miklik wrote:
> Selected text seems to me like neverending cycle. I don't see the way out
> and also variable l is always l<=0.
You are right for the l<=0. Fixed.
As for the neverending cycle, I can't follow you:
for (int i = 1; ; i++) {
...
if (i == 10) {
throw e;
}
}
Jochen
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org