我是学生,目前正在研究通过DDS传输文件的方法。我在ubuntu终端上运行dds版本6.3并成功发布和订阅。问题是我想编辑邮件,同样我想在邮件中传输文件。有没有人可以帮助我?非常感谢
答案 0 :(得分:0)
这个答案不是openplice特有的,它是通用的DDS。
您正在发送消息,而您正在发布实例。如果要编辑实例,请执行此操作并再次发布。此重新发布的实例可能来自原始发布者实体,也可能来自已收到该实例的订阅者,已编辑该实例,然后重新发布该实例。
伪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,因为它有一个File存储。它寻找,找到所请求的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传输并按上述方式发布,但现在状态为&#34; OS_In_Process&#34;。当sftp完成后,它会发布一个&#34; OS_Complete&#34; (或两个&#34; OS_Failed&#34;状态之一)样本。
我意识到这是一个为期一年的问题,但它可能仍然有助于人们了解如何使用DDS完成任务,或者如何在DDS概念空间中查看事物。