moved getsocket to util