Calling a Java function repeatedly
<p>I'm not a CS guru nor a Java expert, so please forgive me if the answer to the following question is obvious:</p>

<p>I've built a class that handles sending a query to an HTTP server, getting the response and returning that response to the caller.</p>

<p>My question is this; If I call that function once, and the response is taking a long time, and during the delay, I call it again, will the delayed first call interfere with the execution of the second call?</p>

<p>By popular demand...here is some source code:</p>

<pre><code>package com.cambrothers.wms.module;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;

public class ServerComm {
public HashMap&lt;String, String&gt; sendData(String endpoint, String requestParameters){
    HashMap&lt;String, String&gt; response_data = new HashMap&lt;String, String&gt;();

    System.out.println("GetRequest");
    if (endpoint.startsWith("http://"))
    {
        // Send a GET request to the servlet
        try
        {

            // Send data
            String urlStr = endpoint;
            if (requestParameters != null &amp;&amp; requestParameters.length () &gt; 0)
            {
                urlStr += "?" + requestParameters;
            }
            URL url = new URL(urlStr);
            URLConnection conn = url.openConnection ();

            // Get the response
            BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            StringBuffer sb = new StringBuffer();
            String line;
            while ((line = rd.readLine()) != null)
            {
                sb.append(line);
            }
            rd.close();
            String result = sb.toString();
            String[] values = result.split("&amp;");
            String[] kp = null;
            for(int i =0; i &lt; values.length ; i++){
                kp = values[i].split("=");
                response_data.put(kp[0], kp[1]);
            }

        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    return response_data;
}
}
</code></pre>

<p>take care</p>
