簡體   English   中英

Jade 中的兩個容器以及不同設備之間的通信

[英]two containers in Jade and communication between different devices

我目前正在學習翡翠。 我發現關於Jade的信息很少。 我可以問兩個問題嗎?

  1. 如何在 Eclipse 或 Netbeans 中構建第二個容器?
  2. 如何啟用兩個不同設備之間的通信,例如一台計算機和一個樹莓派?
  1. 關於容器創建(假設您已經在某處有一個主容器):

     Runtime rt = Runtime.instance(); String containerName; ProfileImpl pContainer; ContainerController containerRef; //create the container containerName="Mycontainer1"; pContainer = new ProfileImpl(PLATFORM_IP, PLATFORM_PORT, PLATFORM_ID); pContainer.setParameter(Profile.CONTAINER_NAME,containerName); //link it to the platform System.out.println("Launching container "+pContainer); containerRef = rt.createAgentContainer(pContainer);

    對於一個完整的工作示例: https://startjade.gitlab.io/CreatePlatform/

  2. 如果設備可以自由通信並且您希望它們成為同一個翡翠實例的一部分,只需在 pi 上部署一個容器(例如),並使其連接到您計算機上的 mainContainer。 然后,平台上的代理將能夠相互通信,無論其位置如何。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM