【问题标题】:omniORBpy terminating the serveromn​​iORBpy 终止服务器
【发布时间】:2011-12-07 16:22:28
【问题描述】:

我正在开发使用omniORBpy 的python 客户端-服务器应用程序,我正在尝试弄清楚如何正确终止服务器。

我有这个方法:

def shutdown(self):
    print "---------------------------------------"
    print "shutdown"
    orb.shutdown(False)
    quit()

但是当我从调用上述函数的客户端发送消息时,会出现此错误:

---------------------------------------
shutdown
omniORB: Caught an unexpected Python exception during up-call.
terminate called after throwing an instance of 'omni_thread_fatal'
Aborted

有人知道我需要做什么才能正确地结束服务器吗?

【问题讨论】:

    标签: python corba


    【解决方案1】:

    您不能关闭服务器(即使不是在单向调用中)。您必须更改“标志”以便经常检查它。如果已设置,请关闭服务器。

    例如,在伪代码中:

    def shutdown():
      self.shutdown = True
    
    def run():
      while not self.shutdown:
         workloop()
    

    或者类似的东西。换句话说;不要在远程调用中杀死服务器。

    【讨论】:

      【解决方案2】:

      您是否将关闭方法设为 IDL 中的单向方法?

      【讨论】:

      • 是的,我做到了:oneway void shutdownDFS();
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多