Understanding client and server code