Implements the client side of the SPICE protocol