7 def __init__(self, config):
9 self.port = int(config.get("Comm", "port"))
12 self.tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
13 self.tcp.bind( (self.host, self.port) )
16 def getMsg(self, size):
17 return self.con.recv(size)
19 def sendMsg(self, msg):
22 def Ack(self, command):
23 msg = "[%s] Command %s received" % (lib.now(), command)
24 self.sendMsg(msg + "\n")
27 self.con, self.client = self.tcp.accept()
28 print "[%s] Received request from ip=%s" % (lib.now(), self.client )
29 return (self.con, self.client)
31 def disconnect_client(self, connection):