Index: /src/main/java/geniusweb/profilesserver/websocket/ProfilesListSocket.java
===================================================================
--- /src/main/java/geniusweb/profilesserver/websocket/ProfilesListSocket.java	(revision 4)
+++ /src/main/java/geniusweb/profilesserver/websocket/ProfilesListSocket.java	(revision 5)
@@ -45,4 +45,5 @@
 	private Session session;
 	private Listener<ChangeEvent> changeListener;
+	private static transient String hostport = ""; // cache
 
 	public ProfilesListSocket() {
@@ -130,15 +131,22 @@
 	private String getIpAddressAndPort()
 			throws UnknownHostException, MalformedObjectNameException {
+		synchronized (hostport) {
+			if (hostport.isEmpty()) {
+				MBeanServer beanServer = ManagementFactory
+						.getPlatformMBeanServer();
 
-		MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer();
+				Set<ObjectName> objectNames = beanServer.queryNames(
+						new ObjectName("*:type=Connector,*"),
+						Query.match(Query.attr("protocol"),
+								Query.value("HTTP/1.1")));
 
-		Set<ObjectName> objectNames = beanServer.queryNames(
-				new ObjectName("*:type=Connector,*"),
-				Query.match(Query.attr("protocol"), Query.value("HTTP/1.1")));
+				String host = InetAddress.getLocalHost().getHostAddress();
+				String port = objectNames.iterator().next()
+						.getKeyProperty("port");
 
-		String host = InetAddress.getLocalHost().getHostAddress();
-		String port = objectNames.iterator().next().getKeyProperty("port");
-
-		return host + ":" + port;
+				hostport = host + ":" + port;
+			}
+			return hostport;
+		}
 
 	}
Index: /src/test/java/geniusweb/clienttest/JavaClientTest.java
===================================================================
--- /src/test/java/geniusweb/clienttest/JavaClientTest.java	(revision 4)
+++ /src/test/java/geniusweb/clienttest/JavaClientTest.java	(revision 5)
@@ -60,18 +60,24 @@
 	@Test
 	public void clientSmokeTest() throws IOException {
-		WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(5000);
-		WebSocket ws = factory.createSocket("ws://localhost:8080/profilesserver/websocket/liststream");
+		WebSocketFactory factory = new WebSocketFactory()
+				.setConnectionTimeout(5000);
+		WebSocket ws = factory.createSocket(
+				"ws://localhost:8080/profilesserver/websocket/liststream");
 	}
 
 	@Test
-	public void testGetList() throws IOException, InterruptedException, WebSocketException {
+	public void testGetList()
+			throws IOException, InterruptedException, WebSocketException {
 		final List<String> received = new LinkedList<>();
 		Thread.sleep(5000);
-		WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(20000);
-		WebSocket ws = factory.createSocket("ws://localhost:8080/profilesserver/websocket/liststream");
+		WebSocketFactory factory = new WebSocketFactory()
+				.setConnectionTimeout(20000);
+		WebSocket ws = factory.createSocket(
+				"ws://localhost:8080/profilesserver/websocket/liststream");
 
 		ws.addListener(new WebSocketAdapter() {
 			@Override
-			public void onTextMessage(WebSocket websocket, String message) throws Exception {
+			public void onTextMessage(WebSocket websocket, String message)
+					throws Exception {
 				System.out.println("received message: " + message);
 				received.add(message);
@@ -81,5 +87,5 @@
 		assertTrue(ws.isOpen());
 
-		Thread.sleep(2000);
+		Thread.sleep(15000);
 
 		assertEquals(1, received.size()); // 1 answer received
@@ -90,8 +96,8 @@
 		Map<String, Object> map = mapper.readValue(received.get(0), typeRef);
 
-		List<String> domains= new LinkedList<>();
-		for (String key: map.keySet()) {
+		List<String> domains = new LinkedList<>();
+		for (String key : map.keySet()) {
 			domains.add(key.substring(key.indexOf("get")));
-			}
+		}
 		assertTrue(domains.contains("get/jobs"));
 		assertTrue(domains.contains("get/7issues"));
@@ -99,5 +105,6 @@
 
 	@Test
-	public void testExample() throws WebSocketException, InterruptedException, IOException {
+	public void testExample()
+			throws WebSocketException, InterruptedException, IOException {
 		DownloadProfileExample test = new DownloadProfileExample();
 		test.run();
@@ -106,5 +113,6 @@
 
 	@Test
-	public void testExample2() throws WebSocketException, InterruptedException, IOException {
+	public void testExample2()
+			throws WebSocketException, InterruptedException, IOException {
 		DownloadProfileExample2 test = new DownloadProfileExample2();
 		assertEquals(JOBS1PROFILE, test.getReceived());
@@ -119,5 +127,6 @@
 
 		// Create factory and coerce Jython calculator object
-		JythonObjectFactory factory = new JythonObjectFactory(WebSocketAdapter.class, "PythonDownloadProfile",
+		JythonObjectFactory factory = new JythonObjectFactory(
+				WebSocketAdapter.class, "PythonDownloadProfile",
 				"PythonDownloadProfile");
 		factory.createObject();
