Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
+++ uspace/srv/loader/main.c	(revision ee06f2a049baaea0e4c9fc693e7c3c34f3105202)
@@ -51,4 +51,5 @@
 #include <sys/types.h>
 #include <ipc/ipc.h>
+#include <ipc/services.h>
 #include <ipc/loader.h>
 #include <loader/pcb.h>
@@ -80,4 +81,6 @@
 static bool is_dyn_linked;
 
+/** Used to limit number of connections to one. */
+static bool connected;
 
 static void loader_get_taskid(ipc_callid_t rid, ipc_call_t *request)
@@ -297,4 +300,15 @@
 	ipc_call_t call;
 	int retval;
+
+	/* Already have a connection? */
+	if (connected) {
+		ipc_answer_0(iid, ELIMIT);
+		return;
+	}
+
+	connected = true;
+	
+	/* Accept the connection */
+	ipc_answer_0(iid, EOK);
 
 	/* Ignore parameters, the connection is already open */
@@ -339,29 +353,18 @@
 int main(int argc, char *argv[])
 {
-	ipc_callid_t callid;
-	ipc_call_t call;
-	ipcarg_t phone_hash;
-
-	/* The first call only communicates the incoming phone hash */
-	callid = ipc_wait_for_call(&call);
-
-	if (IPC_GET_METHOD(call) != LOADER_HELLO) {
-		if (IPC_GET_METHOD(call) != IPC_M_PHONE_HUNGUP)
-			ipc_answer_0(callid, EINVAL);
-		return 1;
-	}
-
-	ipc_answer_0(callid, EOK);
-	phone_hash = call.in_phone_hash;
-
-	/* 
-	 * Up until now async must not be used as it couldn't
-	 * handle incoming requests. (Which means e.g. printf() 
-	 * cannot be used)
-	 */
-	async_new_connection(phone_hash, 0, NULL, loader_connection);
+	ipcarg_t phonead;
+
+	connected = false;
+	
+	/* Set a handler of incomming connections. */
+	async_set_client_connection(loader_connection);
+
+	/* Register at naming service. */
+	if (ipc_connect_to_me(PHONE_NS, SERVICE_LOAD, 0, 0, &phonead) != 0) 
+		return -1;
+	
 	async_manager();
 
-	/* not reached */
+	/* Never reached */
 	return 0;
 }
