RUBY-556 fix potential deadlocks with broadcast
RUBY-550 socket util module and refactoring