commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen, Michael B (RSCH)" <Michael_B_Al...@ml.com>
Subject httpclient hangs indefinately
Date Thu, 31 Jan 2002 03:50:12 GMT
If I just use a simple test program like below and try to connect to certain IP addresses that
are routable but don't have anything listing at the other end (returns nothing, dead air),
the
client hangs indefinately. Can anyone think of a solution to this problem?

Thanks,
Mike

import org.apache.commons.httpclient.*;

public class Test {

        public static void main(String[] argv) throws Exception {
                HttpConnection con = new HttpConnection( argv[0], Integer.parseInt( argv[1]
));
                con.open();
                con.printLine( "GET /index.html HTTP/1.0" );
                con.printLine();
                String s;
                while(( s = con.readLine() ) != null ) {
                        System.out.println( s );
                }
        }
}


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message