Implemented ws_util_create_socket

This is for #384 
Remove the "util" in the name pls.