add method to control socket blocking/non-blocking mode