+ /* Try connecting to a root sessiond first */
+ client = new LttngTcpSessiondClient(clientListener, DOMAIN_VALUE, true);
+ clientThread = new Thread(client);
+ clientThread.start();
+
+ if (client.waitForConnection(5)) {
+ return;
+ }
+
+ /* Connection was not established, try a user sessiond instead */
+ client.close();
+ try {
+ clientThread.join();
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+
+ client = new LttngTcpSessiondClient(clientListener, DOMAIN_VALUE, false);