title: Python 3.4 ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1638)
body: <p>I've the project to connect a distant vim (on my server) to my client with PIPE of the subprocess stdin, stdout through a SSL socket. I use Python 3.4.
  My socket (cSock in the code) is SSL wrapped and i've the same error each time I try to open Vim. Here my code:</p>
  
  <pre><code>vimProc = sp.Popen(["rvim", file], bufsize=0, stdin=sp.PIPE, stdout=sp.PIPE)
  
  cSock.settimeout(1)
  
  rec = Reception(cSock, vimProc)
  emi = Emission(cSock, vimProc)
  
  rec.start()
  emi.start()
  
  rec.join()
  emi.join()
  </code></pre>
  
  <p>And here my threads of Reception and Emission</p>
  
  <pre><code>class Reception(threading.Thread):
  
  def __init__(self, sock, proc):
      threading.Thread.__init__(self)
      self.sock = sock
      self.proc = proc
  
  def run(self):
      while self.proc.poll() == None:
          try:
              self.proc.communicate(self.sock.recv(1))
          except socket.timeout:
              pass
  
  
  class Emission(threading.Thread):
  
  def __init__(self, sock, proc):
      threading.Thread.__init__(self)
      self.sock = sock
      self.proc = proc
  
  def run(self):
      while self.proc.poll() == None:
          try:
              outs = self.proc.stdout.read(1)
              if outs == "":
                  print("EOF reached")
              else:
                  self.sock.send(outs)
  
          except socket.timeout: 
              pass
  </code></pre>
  
  <p>And here the traceback:</p>
  
  <pre><code>Exception in thread Thread-2:
  Traceback (most recent call last):
    File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
      self.run()
    File ".../server/edition.py", line 62, in run
      self.sock.send(outs)
    File "/usr/lib/python3.4/ssl.py", line 678, in send
      v = self._sslobj.write(data)
  ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1638)
  </code></pre>
  
  <p>Any solution?</p>