lib/ftw/server.rb in ftw-0.0.47 vs lib/ftw/server.rb in ftw-0.0.48
- old
+ new
@@ -104,10 +104,10 @@
# Yield FTW::Connection instances to the block as clients connect.
def each_connection(&block)
# TODO(sissel): Select on all sockets
# TODO(sissel): Accept and yield to the block
stopper = @stopper[0]
- while true
+ while !@sockets.empty?
@control_lock.synchronize do
sockets = @sockets.values + [stopper]
read, write, error = IO.select(sockets, nil, nil, nil)
break if read.include?(stopper)
read.each do |serversocket|