add pool to manage connections

* enhance the helper function to setup validations
* fix validation callback flow
* create an Array acting as a socket pool to determine new connections
* add error handler that removes sockets from the pool