def handle_connect(self): self.keepalive() cfg.atm[self.wsid]['bnm_conn'] = time.time() log.l.LogIt('RTB002', 'I', '%s bnm connected on port %s', (self.wsid, self.getsockname()[1])) cfg.domain[self.name]['bnmconnect'] = 1 cfg.atm[self.wsid]['bnmstate'] = 'o' cfg.atm[self.wsid]['bnmdata'] = [] # tell bnmroutc ip = cfg.domain[self.name]['server'][cfg.domain[self.name]['active']] if cfg.servers[ip]['routc']: cfg.servers[ip]['routc'].routcEvt(routc.bnmConnect(self.name, self.wsid)) #-------------- self.pbmpkt_hdr = '' self.pbmpkt_buf = '' self.pbmpkt_len = 0
def handle_connect(self): self.keepalive() log.l.LogIt('RBC003', 'I', 'bnmroutc %s connected on port %s', (self.ip, self.getsockname()[1])) cfg.servers[self.ip]['routc'] = self self.msgbuf = [] self.msgbuf.append(routc.heartBeat()) # send all connected and status messages to this bnmroutc atms = cfg.atm.keys() for i in atms: dom = cfg.atm[i]['domain'] if cfg.atm[i]['gastate'] == '=' or cfg.atm[i]['gastate'] == 'o' and \ dom != '': ip = cfg.domain[dom]['server'][cfg.domain[dom]['active']] if ip == self.ip: cfg.servers[ip]['routc'].routcEvt(routc.atmConnect(dom, i)) ga = cfg.atm[i]['gasock'] if ga.tcpip: self.routcEvt(routc.ipAddr(dom, i, ga.peer_ip)) else: self.routcEvt(routc.x25Addr(dom, i, ga.pvc)) self.routcEvt(routc.x25Status(dom, i, ga.pvc, '%x'%(cfg.snaid[ga.pvc]['status'] & ~0x800))) if cfg.atm[i]['bnmstate'] == 'o': self.routcEvt(routc.bnmConnect(dom, i))