【问题标题】:DDS data distribution service openspliceDDS 数据分发服务 opensplice
【发布时间】:2014-05-22 07:53:53
【问题描述】:

我是一名学生,目前正在研究通过 DDS 传输文件的方法。我在 ubuntu 终端上运行了 dds 6.3 版并成功发布和订阅。问题是我想编辑消息,同样我想在消息中传输文件。有没有人可以帮助我?将不胜感激

【问题讨论】:

    标签: file publish data-distribution-service opensplice


    【解决方案1】:

    这个答案不是特定于 opensplice 的,它是通用的 DDS。

    1. 没有编辑“消息”的概念。没有 消息(这是在 DDS 概念/术语空间中)。一个“发送 信息包”在一个主题上,并且是一个实例 该主题,或该主题实例的样本,如果主题 是一个关键主题。

    您不是在发送消息,而是在发布一个实例。如果要编辑实例,请执行此操作并再次发布。这个重新发布的实例可能来自原始发布者实体,也可能来自接收它、编辑它然后重新发布它的订阅者。

    1. 如果要传输文件,请使用文件传输程序(ftp、tftp、sftp 等)。当然考虑使用 DDS 作为该过程的控制器(系统 A 需要系统 B 维护的文件。系统 A 发布请求,系统 B 设置并触发文件的 sftp 传输,然后发布“作业完成”实例。

    伪idl:

    enum ObjectiveState {
        OS_Desire,    // "I need this"
        OS_Can,       // "I am able to supply this"
        OS_Can_Not,   // "I am not able to supply this"
        OS_In_Process, // "I am doing this"
        OS_Complete,  // "I did this"
        OS_Failed,     // "Tried, but unable to complete, try again maybe?"
        OS_PermanentFail // "Tried, but can't complete."
    };
    
    struct FileTxReq {
        long long reqid; //@key
        DestinationNode dest; // idl not supplied, some GUID thing
        string<256> sourceUri;
        string<256> destUri;
        ObjectiveState state;
    };
    

    然后系统 A 会在 FileRequestTopic 上发布一个样本:

    reqid:  0x1234
    dest:  {systemA}
    sourceUri:   "/store/publicfiles/theImageFile.jpg"
    destUri:     "/Users/me/drop/theImageFile.jpg"
    state:  OS_Desire
    

    系统 B 将订阅 FileRequestTopic,因为它有一个文件存储。它查找、找到请求的 uri,然后发布

    reqid:  0x1234  (note this is the same reqid as received)
    dest:   {systemA}  (note this is also copied from the received instance)
    sourceUri:   "/store/publicfiles/theImageFile.jpg" (also the same)
    destUri:     "/Users/me/drop/theImageFile.jpg"  (also the same)
    state:  OS_Can
    

    系统 B 启动 sftp 传输并按上述方式发布,但现在状态为“OS_In_Process”。当 sftp 完成时,它会发布一个“OS_Complete”(或两个“OS_Failed”状态之一)示例。

    我知道这是一个老问题,但它可能仍然有助于人们了解如何使用 DDS 完成事情,或者如何在 DDS 概念空间中看待事情。

    【讨论】:

      猜你喜欢
      • 2016-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多