# TCPSocket.new Errno::EBADF: Bad file descriptor error

**URL:** <https://www.ruby-forum.com/t/tcpsocket-new-errno-bad-file-descriptor-error/115475>\
**Category:** Rails\
**Created:** [September 25, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/tcpsocket-new-errno-bad-file-descriptor-error/115475 "2007-09-25T17:38:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [September 25, 2007, 5:38pm UTC](https://www.ruby-forum.com/t/tcpsocket-new-errno-bad-file-descriptor-error/115475/1 "2007-09-25T17:38:51Z")

</div>

Im trying to use memcache-client, but there is a line in their where it  
calls:

TCPSocket.new(host, port). It fails at this point. I’ve tried just  
trying to establish a connection in my script/console with

TCPSocket.new(“localhost”, 11211)  
TCPSocket.new(“127.0.0.1”, 11211)  
TCPSocket.new("", 11211)  
TCPSocket.new("", 11211)

And I also tried with different ports. I had my Norton AV firewall  
turned off as well and even tried this on my friends computer in the  
script/console environment.

We have not been able to get a connection established in any attempts.

Does anyone know what might be wrong?
