# TCPSocket.new(host,port).readline hangs on windows :(

**URL:** <https://www.ruby-forum.com/t/tcpsocket-new-host-port-readline-hangs-on-windows/189407>\
**Category:** Rails\
**Created:** [May 31, 2010, 1:51pm UTC](https://www.ruby-forum.com/t/tcpsocket-new-host-port-readline-hangs-on-windows/189407 "2010-05-31T13:51:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hostep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a88e57/32.png) [@hostep](https://www.ruby-forum.com/u/hostep)\
**Post date:** [May 31, 2010, 1:51pm UTC](https://www.ruby-forum.com/t/tcpsocket-new-host-port-readline-hangs-on-windows/189407/1 "2010-05-31T13:51:53Z")

</div>

Hi Guys

I am starting a new thread as it seems my gripe isnt to do with  
Juggernaut but with TCPSocket - which is used by Juggernaut.

Turns out that the thing that actually hangs up in Juggernaut after x  
(130/1500/16000) iterations of

(1…1000).each {|i| Juggernaut.show\_clients}

Is actually the line

res \<\< @socket.readline(CR) if response

in juggernaut.rb.

Seems @socket.readline behaves nicely when there is something to read,  
but fails miserably with a hangup when there isnt. Even a socket to my  
pop mailserver fails:

@socket = TCPSocket.new (mailserver,110)  
@socket.readline \>\> “+OK\r\n”  
@socket.readline \>\> hang

Maybe I am grasping at straws here - for a full description of my  
problem with Juggernaut on Windows see

[http://www.ruby-forum.com/topic/210450#new](http://www.ruby-forum.com/topic/210450#new)

Any ideas would be appreciated!

Pieter H.
