Switched sockets over to socket_ functions