title: xDebug [Errno 24] Too many open files when connecting to DBGp Proxy
body: <p>I'm having issues running an xDebug session when I've connected to the DBGp proxy successfully.  I'm using both local and remote SSH tunnels for port 9000 (xdebug), and 9001 for a (xdebug DBGp client).</p>
  
  <p>] The code is being debugged remotely, the xDebug server is running on an Amazon EC2 instance</p>
  
  <p>] I am using Zend Studio for my local debugging client on my Macbook</p>
  
  <p>] I am running a remote SSH tunnel for port 9000 "ssh ec2-user@X.X.X.X -R 9000/127.0.0.1/9000"</p>
  
  <p>As of here, I'm able to successfully use xDebug, but then I run into issues running the proxy</p>
  
  <hr>
  
  <p>But then I start running into issues running the proy:</p>
  
  <p>] I then run the dbgp proxy on the remote server</p>
  
  <pre><code>./pydbgpproxy 
  INFO: dbgp.proxy: starting proxy listeners.  appid: 20906
  INFO: dbgp.proxy:     dbgp listener on 127.0.0.1:9000
  INFO: dbgp.proxy:     IDE listener on  127.0.0.1:9001
  </code></pre>
  
  <p>] I then setup a local SSH tunnel for port 9001 - "ssh ec2-user@X.X.X.X -L 9001/127.0.0.1/9001"</p>
  
  <p>] From Zend Studio I'm able to connect successfully to the DBGp server, where "SessionName" is the name of my session</p>
  
  <pre><code>INFO: dbgp.proxy: Server:onConnect ('127.0.0.1', 51828) [proxyinit -p 9000 -k SessionName -m 0]
  </code></pre>
  
  <p>] When I trigger a remote xdebug debugging sessions using my session name, it fails like so.  </p>
  
  <pre><code>INFO: dbgp.proxy: connection from 127.0.0.1:39172 [&lt;__main__.sessionProxy instance at 0x122e0e0&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39173 [&lt;__main__.sessionProxy instance at 0x7f87980210e0&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39174 [&lt;__main__.sessionProxy instance at 0x7f87980243b0&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39175 [&lt;__main__.sessionProxy instance at 0x7f879814c878&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39176 [&lt;__main__.sessionProxy instance at 0x7f87800a2368&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39177 [&lt;__main__.sessionProxy instance at 0x123cb48&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39178 [&lt;__main__.sessionProxy instance at 0x12387e8&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39179 [&lt;__main__.sessionProxy instance at 0x122ec68&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39180 [&lt;__main__.sessionProxy instance at 0x124fb48&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39181 [&lt;__main__.sessionProxy instance at 0x7f8798047dd0&gt;]
  INFO: dbgp.proxy: connection from 127.0.0.1:39182 [&lt;__main__.sessionProxy instance at 0x1244d88&gt;]
  
  ERROR: dbgp.proxy: Unable to connect to the server listener 127.0.0.1:9000 [&lt;__main__.sessionProxy instance at 0x7f8790025878&gt;]
  
  Traceback (most recent call last):
  
    File "./pydbgpproxy", line 222, in startServer
  
    File "/usr/lib64/python2.6/socket.py", line 184, in __init__
  
  error: [Errno 24] Too many open files
  
  WARNING: dbgp.proxy: Unable to connect to server with key [SessionName], stopping request [&lt;__main__.sessionProxy instance at 0x7f8790025878&gt;]
  
  WARNING: dbgp.proxy: Exception in _cmdloop [[Errno 104] Connection reset by peer]
  
  INFO: dbgp.proxy: session stopped
  </code></pre>
  
  <hr>
  
  <p>It actually shows those lines like "INFO: dbgp.proxy: connection from 127.0.0.1:39179 [&lt;<strong>main</strong>.sessionProxy instance at 0x122ec68>]" almost 50x more than what I copied and pasted here for brevity.</p>
  
  <p>It seems like I got it to work but it's erring out.  I'm currently using the pydbgpproxy phyton script, version 7 from:  <a href="http://code.activestate.com/komodo/remotedebugging/" rel="nofollow">http://code.activestate.com/komodo/remotedebugging/</a>.  I tried the version 8 script but it just errors. I also tried the pydbgpprox, version 6, but it still has the same exact issue.  </p>
  
  <p>IN SUMMARY: xDebug is running on the server, I can connect to it normally without proxy.  With the proxy I can connect to it successfully to, but then running a script it encounters this werid error.  </p>
  
  <p>Does anyone know what this issue might be caused from? </p>