tags:

views:

133

answers:

1

We have a Java app, as well as a number of C#-based plugins for other apps (e.g. Excel) that can communicate with the main app. The communications layer is implemented using Apache MINA on the Java side and xsd for the .NET plugins. Typically things run on the same (Windows) machine, though it would be better not to assume that (e.g., allow the main app to run on a Mac and be able to communicate with Excel on a different machine).

The communication has to work regardless of whether the main app or the plugin(s) start up first. My question is how best to establish the link? Currently, our main Java app listens on a port that the plugins constantly poll for availability. This is obviously wasteful and inelegant. But it works.

An alternative would be to have each plugin listening on its own port, and when the app starts up it sends a "Hello" kind of message to each known port (on localhost), and then have the plugins establish the link at that point.

I've also looked a bit at multicast, but don't really know much about it. And of course, there could be multiple users on the same subnet all using the app.

Any other ideas or thoughts?

A: 

You should not be concerned with wasted attempts to connect to the server - it is not a resource intensive operation and the plugin requires the connection to work. There does not seems to be any real motivation to use anything different from a traditional client/server approach which you already are doing.

Timothy Pratley