def output(self): tcpippkt = cfg.atm[self.wsid]['bnmdata'][0] ebcdicpkt = tcpippkt[6:] now = time.time() if cfg.data_hdlr: cfg.data_buf.append(1, now, ebcdicpkt) pbmascii = pbm.ebcdic2ascii(ebcdicpkt) cfg.atm[self.wsid]['go_time'] = now log.l.LogIt('RTG007', 'D', 'go: %s', (pbmascii)) if self.tcpip: result = pbm.sendpkt(self, tcpippkt) else: result = sna_hdlr.send(self.pvc, ebcdicpkt) if result: cfg.atm[self.wsid]['bnmdata'] = cfg.atm[self.wsid]['bnmdata'][1:] #---------------------- if pbmascii[8] == 'F': if pbmascii[9] == 'P': cfg.atm[self.wsid]['txcnt'] = cfg.atm[self.wsid]['txcnt'] + 1 else: cfg.atm[self.wsid]['txcnt'] = 0 if cfg.atm[self.wsid]['txcnt'] == 2: log.l.LogIt('RTG008', '1', '%s: tx end', (self.wsid)) cfg.atm[self.wsid]['tx'] = '-' cfg.atm[self.wsid]['txcnt'] = 0
def handle_write(self): if self.writeflag: log.l.LogIt('BNH002', 'D', 'o: %s', (self.senddata)) ebcdic = pbm.ascii2ebcdic(self.senddata) tcpippkt = pbm.pbm2header(ebcdic) + ebcdic result = pbm.sendpkt(self, tcpippkt) if result: self.writeflag = 0
def handle_write(self): if len(cfg.atm[self.wsid]['gadata']) == 0: return tcpippkt = cfg.atm[self.wsid]['gadata'][0] log.l.LogIt('RTB004', 'D', 'bo: %s', pbm.ebcdic2ascii(tcpippkt[6:])) result = pbm.sendpkt(self, tcpippkt) if result: cfg.atm[self.wsid]['gadata'] = cfg.atm[self.wsid]['gadata'][1:]