def __init__(self, addr, standard_client=None):
cmd.Cmd.__init__(self)
self.addr = addr
self.sok = nnpy.Socket(nnpy.AF_SP, nnpy.REQ)
try:
self.sok.connect(self.addr)
self.sok.setsockopt(nnpy.SOL_SOCKET, nnpy.RCVTIMEO, 500)
except:
print "Impossible to connect to provided socket (bad format?)"
sys.exit(1)
self.req_id = 0
self.switch_id = 0
# creates new attributes
self.reset()
# creates new attributes
self.standard_client = standard_client
self.json_dependent_init()
评论列表
文章目录