4 ## Copyright (c) 2010-2017 Intel Corporation
6 ## Licensed under the Apache License, Version 2.0 (the "License");
7 ## you may not use this file except in compliance with the License.
8 ## You may obtain a copy of the License at
10 ## http://www.apache.org/licenses/LICENSE-2.0
12 ## Unless required by applicable law or agreed to in writing, software
13 ## distributed under the License is distributed on an "AS IS" BASIS,
14 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ## See the License for the specific language governing permissions and
16 ## limitations under the License.
22 def __init__(self, ip):
25 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
27 sock.connect((self._ip, 8474))
29 raise Exception("Failed to connect to PROX on " + self._ip + ":8474")
33 self._sock.sendall(msg + "\n");
39 if (len(self._dat) == 0):
40 self._dat = self._sock.recv(256);
42 while(len(self._dat)):
43 if (self._dat[0] == '\n'):
45 self._dat = self._dat[1:]
48 ret_str += self._dat[0];
49 self._dat = self._dat[1:]
52 def wait_cmd_finished(self):
53 self.send("stats hz").recv();