Implemented ws_util_create_socket

This is for #384