def onClose(self, wasClean, code, reason):
# print("onClose")
# print("WebSocket connection closed: {0}".format(reason), "code: ",
# code, "clean: ", wasClean, "reason: ", reason)
self.summary[self.uttNumber]['status']['code'] = code
self.summary[self.uttNumber]['status']['reason'] = reason
# create a new WebSocket connection if there are still
# utterances in the queue that need to be processed
self.queue.task_done()
if self.factory.prepareUtterance() == False:
return
# SSL client context: default
if self.factory.isSecure:
contextFactory = ssl.ClientContextFactory()
else:
contextFactory = None
connectWS(self.factory, contextFactory)
# function to check that a value is a positive integer
评论列表
文章目录