MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / get_packages_count

Function get_packages_count

tools/donate_cpu_lib.py:261–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259
260
261def get_packages_count():
262 def __get_packages_count():
263 print('Connecting to server to get count of packages..')
264 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
265 sock.connect(__server_address)
266 sock.send(b'getPackagesCount\n')
267 packages = sock.recv(64)
268 # TODO: sock.recv() sometimes hangs and returns b'' afterwards
269 if not packages:
270 raise Exception('received empty response')
271 return int(packages)
272
273 return try_retry(__get_packages_count)
274
275
276def get_package(package_index=None):

Callers

nothing calls this directly

Calls 1

try_retryFunction · 0.85

Tested by

no test coverage detected