I would like to send a message ONLY to the event server without allowing other servers/clients/components to eavesdrop.
According to the documentation on the MessageCommunication.TransmitMessage I must provide the endpointFQID of the event server to only send the message to the that server.
“When the destinationEndPoint is filled, the message is first sent to the EventServer, that again will forward to the specified endpoint - without any validation of the message filters.”
I found MessageCommunication.ServerEndPointFQID suitable to use for this purpose:
“Get the FQID that identifies the EventServer instance”
However, when looking at this FQID during runtime it has an “empty” ObjectId:
According to the documentation on the MessageCommunication.
TransmitMessage method:
“If the destinationEndPoint is filled with an ObjectId of Guid.Empty the message is considered a broadcast, and will be transmitted to all clients currently logged in.”
How do we find the unique endpoint FQID of the event server, to perform private communication?
The documentation is unclear and Milestone Development will make sure it gets looked into.
For now you will have to use an ObjectId of Guid.Empty, even as it is possible for others to pick it up. You cannot consider the communication private and if you need security you should consider introducing encryption of some sort..
Thank you, so you can’t think of any other way in the SDK for a client to communicate with the event-server plugin only. Encrypting the payload is of course an option but it will require setting up keys in advance which we would like to avoid.
Hi Mikael,
We will fix the empty objectId so that the described approach will work, but for now you can do the following as a work-around:
_msgComm.RegisterCommunicationFilter(WhoAreOnlineResponseHandler,
new VideoOS.Platform.Messaging.CommunicationIdFilter(MessageCommunication.WhoAreOnlineResponse));
_msgComm.TransmitMessage(
new VideoOS.Platform.Messaging.Message(MessageCommunication.WhoAreOnlineRequest), null, null,
null);
private object WhoAreOnlineResponseHandler(Message message, FQID destination, FQID sender)
{
Collection<EndPointIdentityData> result = message.Data as Collection<EndPointIdentityData>;
foreach (var epid in result)
{
if (epid.EndPointFQID.ServerId.ServerType == "Service")
{
\_serviceId = epid.EndPointFQID.ObjectId;
break;
}
}
return null;
}
// finally, when sending the ‘secret’ message:
var fqid = \_msgComm.ServerEndPointFQID.Clone();
fqid.ObjectId = \_serviceId;
\_msgComm.TransmitMessage(new Message(MsgComPrivacyDefinition.MySecrectMessage) { Data = "Something secret" }, fqid, null, null);
Just be aware that any plugin in the Event Server will be able to listen for the message, so this only guarantees that it will not be passed on to other applications.