Skip to content
Browse files

+ Make tcp server selectable

It would never be ready unless you called #get
  • Loading branch information...
1 parent e3c1f01 commit 016db3c6bd82dec494bb850c4021fb8b69558357 @kschiess committed
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/cod/tcp_server.rb
  2. +4 −0 spec/acceptance/tcp_operation_spec.rb
View
2 lib/cod/tcp_server.rb
@@ -80,7 +80,7 @@ def close
# Returns an array of IOs that Cod.select should select on.
#
def to_read_fds
- @client_sockets
+ @client_sockets + [@socket]
end
# Returns the number of clients that are connected to this server
View
4 spec/acceptance/tcp_operation_spec.rb
@@ -17,6 +17,10 @@
client.put :test
server.get.should == :test
end
+ it "allows Cod.select for server" do
+ client.put :test
+ Cod.select(0.1, server).should == server
+ end
it "correctly shuts down the background thread" do
client.put :test

0 comments on commit 016db3c

Please sign in to comment.
Something went wrong with that request. Please try again.