Added some functions to socket utility library.