我正在尝试为我的机器人做一个松散的集成。这是我的python脚本,它将在空闲时运行bot:
from rasa_core.channels import HttpInputChannel
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_slack_connector import SlackInput
nlu_interpreter = RasaNLUInterpreter('./model/nlu/default/weathernlu')
agent = Agent.load('./model/dialogue', interpreter = nlu_interpreter)
input_channel = SlackInput('*******', #app verification token
'*******', # bot verification token
'********', # slack verification token
True)
agent.handle_channel(HttpInputChannel(5006, '/', input_channel))
我的问题是每次我关闭应用程序并尝试运行它时,我不能使用同一个端口。我从5000开始,你可以看到我达到了5006,因为我每次都要改变它。如果我尝试使用同一端口运行它,则会出现以下错误:
OSError: [WinError 10048] Only one usage of each socket address (protocol/networ k address/port) is normally permitted
有人能解释一下发生了什么吗?在
您应该使用cmd netstat检查绑定了哪个端口,还应该检查计算机上仍在运行的进程。在
关闭你的应用程序可能不会终止进程,因此你的应用程序的前一个实例可能仍然使用这些端口。在
相关问题 更多 >
编程相关推荐