# TCPSocket.open in 1.8.6 Windows?

**URL:** <https://www.ruby-forum.com/t/tcpsocket-open-in-1-8-6-windows/109121>\
**Category:** Ruby\
**Created:** [July 11, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/tcpsocket-open-in-1-8-6-windows/109121 "2007-07-11T16:53:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dick\_Monahan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e99b99/32.png) [@Dick\_Monahan](https://www.ruby-forum.com/u/Dick_Monahan)\
**Post date:** [July 11, 2007, 4:53pm UTC](https://www.ruby-forum.com/t/tcpsocket-open-in-1-8-6-windows/109121/1 "2007-07-11T16:53:09Z")

</div>

I have a program that works under Windows XP and Ruby 1.8.5. I just  
switched to 1.8.6 and a new bug appeared.

In net/imap.rb, there is a statement “@sock = TCPSocket.open(host,  
port)”.  
If host is a remote URL (e.g., [www.anywhere.com](http://www.anywhere.com)), it works. If host is  
“localhost”, or “127.0.0.1”, or my local Host Name, or my local IP  
Address,  
it fails with “Bad file descriptor - connect(2) (Errno::EBADF)”.

Since most of my test sites are on my local computer, this makes testing  
difficult, if not impossible.

Help?
