I wasn't able to find how to close a socket in Ruby.  That's why I was just setting it to nil.