MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / __init__

Method __init__

AgentBench.old/src/tasks/card_game/server.py:7–19  ·  view source on GitHub ↗
(self, port, workers, host='localhost')

Source from the content-addressed store, hash-verified

5
6class Server:
7 def __init__(self, port, workers, host='localhost'):
8 self.host = host
9 self.port = port
10 self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
11
12 while (True):
13 try:
14 self.socket.bind((self.host, self.port))
15 break
16 except OSError as e:
17 self.port += 1
18 self.socket.listen(workers+2)
19 self.log = {}
20
21 def start(self, folder, session):
22 log_file = []

Callers

nothing calls this directly

Calls 1

listenMethod · 0.45

Tested by

no test coverage detected