class MyClass(GeneratedClass): def __init__(self): GeneratedClass.__init__(self) def onLoad(self): #put initialization code here pass def onUnload(self): #put clean-up code here pass def onInput_onStart(self, p): #self.onStopped() #activate the output of the box # p est l'instruction à envoyer au serveur import socket # Recup des parametres de la boite ip_address=self.getParameter("ip_adress") port_number=self.getParameter("port_number") # Connexion au serveur avec IP et port s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ip_address, port_number)) s.send(p) r = s.recv(9999999) self.onStopped() pass def onInput_onStop(self): self.onUnload() #it is recommended to reuse the clean-up as the box is stopped self.onStopped() #activate the output of the box