What this result means?
***********************************************
main
{
URL url = new URL (HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println (connection.getContent());
URL url = new URL (HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println (connection.getContent());
URL url = new URL (HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println (connection.getContent());
}
************************************
main{
URL url = new URL (http:/HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println(connection.getContent());
}
*************************************
to run first one and to run second one three times
has different output.
After executing first program,
java.io.pushBackInputStream@345
java.io.pushBackInputStream@478
java.io.pushBackInputStream@890
After excuting second program first time,
java.io.pushBackInputStream@345
After executing second program second time,
java.io.pushBackInputStream@345
After executing second program third time,
java.io.pushBackInputStream@345
1.What I am wondering is
in one program, the connection has unique output.
that means a lot of connections are connected while the program is alive. The more threads are executed, the more different connections are made. Is there any limitation for this number of connections on one URL. Because I create this HttpURLConnection instances a lot.
2. what's the meaning of the content of getContent()?
3. connection.disconnect() makes the connection unavailable?
4. while the program is running, the connection is still available?
it's hard to understand for you what I am asking?
please ask me again.
thanks.
***********************************************
main
{
URL url = new URL (HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println (connection.getContent());
URL url = new URL (HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println (connection.getContent());
URL url = new URL (HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println (connection.getContent());
}
************************************
main{
URL url = new URL (http:/HttpURLConnection connection = (HttpURLConnection)url.openConnection();
System.out.println(connection.getContent());
}
*************************************
to run first one and to run second one three times
has different output.
After executing first program,
java.io.pushBackInputStream@345
java.io.pushBackInputStream@478
java.io.pushBackInputStream@890
After excuting second program first time,
java.io.pushBackInputStream@345
After executing second program second time,
java.io.pushBackInputStream@345
After executing second program third time,
java.io.pushBackInputStream@345
1.What I am wondering is
in one program, the connection has unique output.
that means a lot of connections are connected while the program is alive. The more threads are executed, the more different connections are made. Is there any limitation for this number of connections on one URL. Because I create this HttpURLConnection instances a lot.
2. what's the meaning of the content of getContent()?
3. connection.disconnect() makes the connection unavailable?
4. while the program is running, the connection is still available?
it's hard to understand for you what I am asking?
please ask me again.
thanks.