// we need to vaidate that there isnt a misconfiguration
// somewhere
try {
String version = String.valueOf(PortMapperTable.PORTMAPPER_VERSION)
+ "\n";
PortMapperTable pt = new PortMapperTable();
Socket s = new Socket(mqa.getHostName(), mqa.getPort());
InputStream is = s.getInputStream();
OutputStream os = s.getOutputStream();
try {
os.write(version.getBytes());
os.flush();
} catch (IOException e) {
// This can sometimes fail if the server already wrote
// the port table and closed the connection
// Ignore...
}
pt.read(is);
is.close();
os.close();
s.close();
PortMapperEntry pme = pt.get(PortMapper.SERVICE_NAME);
String remotebrokerid = pme.getProperty("brokerid");
if (mybrokerid.equals(remotebrokerid)) {
logger.log(Logger.ERROR, BrokerResources.E_BID_CONFLICT,