jvm_bind problem when downloading through java
<p>i have written the following code to download file.</p>

<pre><code>         java.io.BufferedInputStream in = 
          new java.io.BufferedInputStream(new java.net.URL(url).openStream());

      java.io.FileOutputStream fos = new java.io.FileOutputStream(filename);

            java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
                    byte[] data = new byte[1024];
             int x=0;
          while((x=in.read(data,0,1024))&gt;=0)
             {

       bout.write(data,0,x);
      }
        if(filename.equalsIgnoreCase("table.csv"))
       {
      updateflag=true;
       }
      if(filename.equalsIgnoreCase("quotes.csv"))
       {
      quoteupdate=true;
        }
     bout.flush();
    bout.close();
       in.close();
</code></pre>

<p>Now, when a file named "table.csv" is passed as paramenter to download function, everything works smooth. Problem is when i try to download "quotes.csv" after i download "table.csv".</p>

<p>The exact calling is this:</p>

<pre><code>             url="http://ichart.finance.yahoo.com/table.csv?    s=%5EBSESN&amp;a=00&amp;b=31&amp;c=2011&amp;d="+(month-1)+"&amp;e="+day+"&amp;f="+year+"&amp;g=d&amp;ignore=.csv";
        updateflag=true;

        downloadDB("table.csv",url);


        System.out.print("quotes to download");

        url="http://download.finance.yahoo.com/d/quotes.csv? 
   s=%5EBSESN&amp;f=sl1d1t1c1ohgv&amp;e=.csv";
         if(candownload==true)
        {
        downloadDB("quotes.csv",url);
         }
        candownload=false;
</code></pre>

<p>I get error saying : Unrecognized Windows Socket error:0: JVM_BIND</p>

<p>Now i understand JVM_BIND is saying i have a process already attached to port 80.
However, i have closed all streams at the end of my function. Why is this happening then?
Thanks in advance</p>
