def __init__(self, sock=None, ConnectionError=ConnectionError, ProtocolError=ProtocolError, UnexpectedCloseError=UnexpectedCloseError): self.set_exns(ConnectionError, ProtocolError, UnexpectedCloseError) if sock == None: self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) else: self.sock = sock self.decode_ctx = asn1.IncrementalDecodeCtx(APDU) self.encode_ctx = asn1.Ctx()
def __init__(self): self.session = session self.decode_ctx = asn1.IncrementalDecodeCtx(APDU) self.encode_ctx = asn1.Ctx() self.handlers = { "initRequest": self.handleInit, "searchRequest": self.handleSearch, "scanRequest": self.handleScan, "close": self.handleClose, "presentRequest": self.handlePresent, "sortRequest": self.handleSort, "deleteResultSetRequest": self.handleDeleteResultSet, "extendedServicesRequest": self.handleExtendedServices }
def connectionMade(self): self.decode_ctx = asn1.IncrementalDecodeCtx(zdefs.APDU) self.encode_ctx = asn1.Ctx() self.result_sets = {} self.close_sent = 0 self.closed = 0
def init(self): self.decode_ctx = asn1.IncrementalDecodeCtx(zdefs.APDU) self.encode_ctx = asn1.Ctx() self.result_sets = {} self.inited = 1