HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

Which channel shall be used for connecting two ThingML ports in a JavaNode? #49

Closed sdalgard closed 9 years ago

sdalgard commented 9 years ago

I have tried with AsyncBroadcast (nothing happends) and WSChan (error when sending)

brice-morin commented 9 years ago

SyncBroadCast should work. It might be an issue with some other channels when a generated component sends a message right away (possibly before the receiver or the channel is started)

maxleiko commented 9 years ago

SyncBroadcast and AsyncBroadcast are local channels. They only work within the same node platform.
If you want multi-node communications, you must either use WSChan or MQTTChannel or create your own.

brice-morin commented 9 years ago

yes, I agree. What is the problem with WSChan?

maxleiko commented 9 years ago

There is no problem with WSChan :)
It just requires you to provide a third-party server. You can start one using the kevoree-js component WSMsgBroker, or (and it is quicker) just install the module locally and globally using:

npm i -g wsmsgbroker

and then start a server using the command-line:

wsbrokerserver 9050
brice-morin commented 9 years ago

@sdalgard can you first try locally (one node) with SyncBroadcast, and then try again with WSChan based on @maxleiko comment?

sdalgard commented 9 years ago

They both work now after fixing the generated ThingML code described in #50

brice-morin commented 9 years ago

Good!