def run(self): """Creates one C2S and one S2S server and runs them. Also initializes the threadpools for each server. """ # imports happen here, because otherwise we could create a cycle from pjs.server import C2SServer, S2SServer self._c2s = C2SServer(self.hostname, self.c2sport, self) self.servers.append(self._c2s) self._s2s = S2SServer(self.hostname, self.s2sport, self) self.servers.append(self._s2s) from pjs.connection import LocalTriggerConnection # see connection.LocalTriggerConnection.__doc__ self.triggerConn = LocalTriggerConnection(self.hostname, self.c2sport) def notifyFunc(): """Function that gets executed when a job in a threadpool completes. """ self.triggerConn.send(' ') self._c2s.createThreadpool(5, notifyFunc) self._s2s.createThreadpool(5, notifyFunc)