add client and fix ntohl conversion