Archived
This forum has been archived. Please start a new discussion on GitHub.
Multicast problem
ashtanko
in Help Center
How do I send a message to several servers at the same time. I used multicast sample, however only one server receives the message.
And another question is how to make a server to send a response as a server generated message to the client.
Thank you.
And another question is how to make a server to send a response as a server generated message to the client.
Thank you.
0
Comments
-
In the multicast demo, the client first sent a multicast request, that corresponds with the call to "lookup", all servers reply to this sending a proxy to a Hello object, and the client invokes the hello method in the first received proxy.
So only the first "lookup" request is UDP multicast, other requests are TCP unicast.
You can run client and servers with --Ice.Trace.Protocol=1 to trace protocol messages.0 -
Thank you for your response.
We are attempting to send a text from the client to all the servers.
We implemented another method sayHelloName(String) in HelloI class.
Then we execute that method in Client.java like this:
hello.sayHelloName("Client says hello to the Server");
Only one server receives it. We would like all servers to get it.
Can you advise how to accomplish that?
As the next step we would like all the servers to send another string back to the client in response.0 -
The server in the demo uses two separate object adapters:
from config.sever# # The server creates a multi-cast object adapter with the name # "Discover". The following line sets the endpoints for this adapter. # Discover.Endpoints=udp -h 239.255.1.1 -p 10000 # # The server creates an object adapter with the name "Hello". The # following line sets the endpoints for this adapter. # Hello.Endpoints=tcp
HelloI servant is added to Hello object adapter, this adapter has just TCP endpoints.
DiscoverI servant is added to Discover object adapter, this use a mulicast endpoint.
You can only send multicast request to servants in the multicast adapter (Discover adapter). So add your method to DiscoverI and call it using the DiscoverPrx.0 -
Hi,
FYI, I added my own demo example for a basic multicast pub/sub :Multicast demo example
Pleasure to share
0
