title: ssl`sysread_nonblock': end of file reached (EOFError)
body: <p>I have written a code which uses ruby threads. </p>
  
  <pre><code>require 'rubygems'
  require 'net/http'
  require 'uri'
  
  def get_response()
  
    uri = URI.parse('https://..........')
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    -----
    -----
  end
  
  t1 = []
  15.times do |i|
  t1[i] = Thread.new{
  hit_mdm(i)
  sleep(rand(0)/10.0)
  }
  end
  
  t1.each {|t| t.join}
  </code></pre>
  
  <p>The code works fine, but when the programs reaches its end it throws following error:</p>
  
  <p><strong>ruby/2.0.0/openssl/buffering.rb:174:in `sysread_nonblock': end of file reached (EOFError)</strong></p>
  
  <p>How to overcome this problem.</p>