def findEndpoints(self):
        self.my_ens_client = ensclient.ENSClient(self.identifier)
        if self.my_ens_client.init():
            self.session = self.my_ens_client.connect(self.network)
            if self.session:
                self.setConnection(self.session.conn)
                self.endpoint = ensclient.ENSEndpoint(self.session.binding["endpoint"])
                print "host {0} port {1}".format(self.endpoint.host, self.endpoint.port)
            else:
                print "failed to connect to ar-network"

        else:
            print "failed to initialize"
            sys.exit(1)
 def getValues(self, xVal, yVal, inverted):
     if self.my_ens_client is None:
         self.my_ens_client = ensclient.ENSClient(self.identifier)
         
     if self.connection is None and self.my_ens_client is not None:
         if self.my_ens_client.init():
             self.connection = self.my_ens_client.connect(self.network)
         else:
             print("failed to initialize")
             sys.exit(1)
             
     if self.connection is not None:
         toRequest = dict()
         toRequest['x'] = xVal
         toRequest['y'] = yVal
         toRequest['inverted'] = inverted
         response = self.connection.request(json.dumps(toRequest))
         print response
         return response
     else:
         print "failed to connect to ar-network"
         
     return None