subscription example

43 views
Skip to first unread message

panzon

unread,
Jan 27, 2012, 2:51:16 AM1/27/12
to yami4
Hi,
I'm already installed and run the examples using different languages
ada - java.
This examples work well when it run under the same node.
When I execute subscribe giving another reference node, I get:
error: Unresolved address. \\when I use java
I/O error. -- when I use ada

I already check my ip's and ports and every is correct and open (I can
also connect using ssh)
I don't want to complicate the simple example, I just want to make it
works

So I was thinking two things to solve it:
1.-
Maybe when you execute the publish/subscriber on different nodes, you
are obligated to use the Broker and I'm not using it... I mean maybe
at first I have to run some shell.
(but I can't find anything about it http://www.inspirel.com/yami4/book/9-3-3.html)

2.-
I have to modify the example Subscriber code; (http://www.inspirel.com/
yami4/book/7-1.html)
I should use the Name Service Resolve
but if thats true, I also should use Name Service Bind on the
Publisher code
... then I thought that I shouldn't modify the examples code... cause
it should work


maybe I'm doing something wrong
I hope you can help me


Maciej Sobczak

unread,
Jan 27, 2012, 4:16:32 AM1/27/12
to yami4
Hello,

On Jan 27, 8:51 am, panzon <el.mas...@gmail.com> wrote:

> I'm already installed and run the examples using different languages
> ada - java.
> This examples work well when it run under the same node.
> When I execute subscribe giving another reference node, I get:
>      error: Unresolved address.    \\when I use java
>      I/O error.                             -- when I use ada
>
> I already check my ip's and ports and every is correct and open (I can
> also connect using ssh)

Please make sure that the port number of your choice (for example,
12345) is not hidden behind a firewall on the machine where you run
the publisher program. The fact that you can connect via ssh might not
be showing the whole truth about your configuration.

Another thing to check is the address that you use for the listener
target, please see:

http://www.inspirel.com/yami4/book/6-1-1.html

The least restrictive way is to use the wildcard for the network
address on the publisher side:

tcp://*:12345

This way the publisher will allow all incoming connections for the
port 12345, even if the machine has several network addresses.
(Note that you might need to escape the whole string if you provide it
on the command line, otherwise * will be interpreted by the shell as a
special character.)

Then, the subscriber will be able to connect with tcp://yourmachine:12345
as a target.

> So I was thinking two things to solve it:
> 1.-
> Maybe when you execute the publish/subscriber on different nodes, you
> are obligated to use the Broker

No, this is not necessary.

> 2.-
> I have to modify the example Subscriber code; (http://www.inspirel.com/
> yami4/book/7-1.html)
> I should use the Name Service Resolve

No, this is not necessary either.

Regards,

--
Maciej Sobczak * http://www.inspirel.com

Ricardo Aguirre

unread,
Jan 27, 2012, 11:41:31 AM1/27/12
to ya...@googlegroups.com
Thank you
My fedora firewall was not working well... I had to completely disable it
But now the example is working preatty well.

I have another doubt:
I saw that yami4 can send all Parameters defined in its package Parameters http://www.inspirel.com/yami4/doc/ada/YAMI.Parameters.html
There I can make basic typed_arrays (boolean, string, integer, etc) or nested types
Looks really easy but

I want to define a nestedtype that inside its collection, it has
1.- some basic Params type elements                               \\ I'm sure that I can define this
2.- an array of another (previously defined) nested type    \\ I don't know how to define this

Do you know if it is possible, to define something like that?
Cause I'm reading documentation but I can not find something similar


These data structures I already have defined in ada and also in idl,
maybe I can generate some standard ada code (using iac) and java code (using idlj)
and then I can transform all dataStructures generated  (
all are Corba types defined by idl compiler) to yami4 Parameters.

I don't know...
I see that you don't use idl on your examples.
I look that you base on your YAMI.Parameters

Tnak you for your help

--Panzón



2012/1/27 Maciej Sobczak <see.my....@gmail.com>

Maciej Sobczak

unread,
Jan 28, 2012, 3:18:02 AM1/28/12
to yami4
On Jan 27, 5:41 pm, Ricardo Aguirre <el.mas...@gmail.com> wrote:

> I have another doubt:
> I saw that yami4 can send all Parameters defined in its package Parametershttp://www.inspirel.com/yami4/doc/ada/YAMI.Parameters.html
> There I can make basic typed_arrays (boolean, string, integer, etc) or
> nested types
> Looks really easy but
>
> I want to define a nestedtype that inside its collection, it has
> 1.- some basic Params type elements                               \\ I'm
> sure that I can define this
> 2.- an array of another (previously defined) nested type    \\ I don't know
> how to define this
>
> Do you know if it is possible, to define something like that?

In the current YAMI4 version it is not possible to create an array of
nested Parameters objects. This functionality might become part of
some future release.

Currently the workaround for this is to express the same data in a
different data structure that does not depend on arrays of Parameters.

> I see that you don't use idl on your examples.

That's right - YAMI4 does not use any static description of data
structures.
Please check the following article for some explanation:

http://www.inspirel.com/articles/What_Is_Wrong_With_IDL.html
Reply all
Reply to author
Forward
0 new messages