Index: uspace/srv/net/app/ping/ping.c
===================================================================
--- uspace/srv/net/app/ping/ping.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/app/ping/ping.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -236,7 +236,8 @@
 	}
 
-	icmp_phone = icmp_connect_module( SERVICE_ICMP );
+	icmp_phone = icmp_connect_module( SERVICE_ICMP, ICMP_CONNECT_TIMEOUT );
 	if( icmp_phone < 0 ){
 		fprintf( stderr, "ICMP connect error %d\n", icmp_phone );
+		return icmp_phone;
 	}
 
Index: uspace/srv/net/include/icmp_common.h
===================================================================
--- uspace/srv/net/include/icmp_common.h	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/include/icmp_common.h	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -40,10 +40,18 @@
 #include <ipc/services.h>
 
+#include <sys/time.h>
+
+/** Default timeout for incoming connections in microseconds.
+ */
+#define ICMP_CONNECT_TIMEOUT	( 1 * 1000 * 1000 )
+
 /** Connects to the ICMP module.
  *  @param service The ICMP module service. Ignored parameter.
+ *  @param[in] timeout The connection timeout in microseconds. No timeout if set to zero (0).
  *  @returns The ICMP module phone on success.
  *  @returns The ICMP socket identifier if called by the bundle module.
+ *  @returns ETIMEOUT if the connection timeouted.
  */
-int	icmp_connect_module( services_t service );
+int	icmp_connect_module( services_t service, suseconds_t timeout );
 
 #endif
Index: uspace/srv/net/include/socket.h
===================================================================
--- uspace/srv/net/include/socket.h	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/include/socket.h	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -62,4 +62,5 @@
  *  @returns ENOMEM if there is not enough memory left.
  *  @returns Other error codes as defined for the NET_SOCKET message.
+ *  @returns Other error codes as defined for the bind_service_timeout() function.
  */
 int	socket( int domain, int type, int protocol );
Index: uspace/srv/net/modules.c
===================================================================
--- uspace/srv/net/modules.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/modules.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -41,25 +41,39 @@
 #include <ipc/services.h>
 
+#include <sys/time.h>
+
 #include "err.h"
 #include "modules.h"
 
-/** The time between connect requests.
+/** The time between connect requests in microseconds.
  */
-#define MODULE_WAIT_TIME	10000
+#define MODULE_WAIT_TIME	( 10 * 1000 )
 
 int connect_to_service( services_t need ){
+	return connect_to_service_timeout( need, 0 );
+}
+
+int connect_to_service_timeout( services_t need, suseconds_t timeout ){
 	int	phone;
 	int	res;
 
-	//TODO timeout version?
-	res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, ( ipcarg_t * ) & phone );
-	while(( res < 0 ) || ( phone < 0 )){
+	while( true ){
+		res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, ( ipcarg_t * ) & phone );
+		if(( res >= 0 ) && ( phone >= 0 )){
+			return phone;
+		}
+		if( timeout > 0 ){
+			timeout -= MODULE_WAIT_TIME;
+			if( timeout <= 0 ) return ETIMEOUT;
+		}
 		usleep( MODULE_WAIT_TIME );
-		res = async_req_3_5( PHONE_NS, IPC_M_CONNECT_ME_TO, need, 0, 0, NULL, NULL, NULL, NULL, ( ipcarg_t * ) & phone );
 	}
-	return phone;
 }
 
 int bind_service( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver ){
+	return bind_service_timeout( need, arg1, arg2, arg3, client_receiver, 0 );
+}
+
+int bind_service_timeout( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout ){
 	ERROR_DECLARE;
 
@@ -67,5 +81,5 @@
 	ipcarg_t	phonehash;
 
-	phone = connect_to_service( need );
+	phone = connect_to_service_timeout( need, timeout );
 	if( phone >= 0 ){
 		if( ERROR_OCCURRED( ipc_connect_to_me( phone, arg1, arg2, arg3, & phonehash ))){
Index: uspace/srv/net/modules.h
===================================================================
--- uspace/srv/net/modules.h	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/modules.h	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -43,4 +43,6 @@
 #include <ipc/services.h>
 
+#include <sys/time.h>
+
 /** Converts the data length between different types.
  *	@param[in] type_from The source type.
@@ -68,4 +70,12 @@
 int connect_to_service( services_t need );
 
+/** Connects to the needed module.
+ *  @param[in] need The needed module service.
+ *  @param[in] timeout The connection timeout in microseconds. No timeout if set to zero (0).
+ *  @returns The phone of the needed service.
+ *  @returns ETIMEOUT if the connection timeouted.
+ */
+int connect_to_service_timeout( services_t need, suseconds_t timeout );
+
 /** Creates bidirectional connection with the needed module service and registers the message receiver.
  *  @param[in] need The needed module service.
@@ -78,4 +88,17 @@
  */
 int	bind_service( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver );
+
+/** Creates bidirectional connection with the needed module service and registers the message receiver.
+ *  @param[in] need The needed module service.
+ *  @param[in] arg1 The first parameter.
+ *  @param[in] arg2 The second parameter.
+ *  @param[in] arg3 The third parameter.
+ *  @param[in] client_receiver The message receiver.
+ *  @param[in] timeout The connection timeout in microseconds. No timeout if set to zero (0).
+ *  @returns The phone of the needed service.
+ *  @returns ETIMEOUT if the connection timeouted.
+ *  @returns Other error codes as defined for the ipc_connect_to_me() function.
+ */
+int	bind_service_timeout( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout );
 
 /** Answers the call.
Index: uspace/srv/net/socket/socket_client.c
===================================================================
--- uspace/srv/net/socket/socket_client.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/socket/socket_client.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -71,4 +71,8 @@
 #define SOCKET_MAX_ACCEPTED_SIZE		0
 
+/** Default timeout for connections in microseconds.
+ */
+#define SOCKET_CONNECT_TIMEOUT	( 1 * 1000 * 1000 )
+
 /** Type definition of the socket specific data.
  *  @see socket
@@ -180,4 +184,5 @@
  *  Connects to the TCP module if necessary.
  *  @returns The TCP module phone.
+ *  @returns Other error codes as defined for the bind_service_timeout() function.
  */
 static int	socket_get_tcp_phone( void );
@@ -186,4 +191,5 @@
  *  Connects to the UDP module if necessary.
  *  @returns The UDP module phone.
+ *  @returns Other error codes as defined for the bind_service_timeout() function.
  */
 static int	socket_get_udp_phone( void );
@@ -262,5 +268,5 @@
 static int socket_get_tcp_phone( void ){
 	if( socket_globals.tcp_phone < 0 ){
-		socket_globals.tcp_phone = bind_service( SERVICE_TCP, 0, 0, SERVICE_TCP, socket_connection );
+		socket_globals.tcp_phone = bind_service_timeout( SERVICE_TCP, 0, 0, SERVICE_TCP, socket_connection, SOCKET_CONNECT_TIMEOUT );
 	}
 	return socket_globals.tcp_phone;
@@ -269,5 +275,5 @@
 static int socket_get_udp_phone( void ){
 	if( socket_globals.udp_phone < 0 ){
-		socket_globals.udp_phone = bind_service( SERVICE_UDP, 0, 0, SERVICE_UDP, socket_connection );
+		socket_globals.udp_phone = bind_service_timeout( SERVICE_UDP, 0, 0, SERVICE_UDP, socket_connection, SOCKET_CONNECT_TIMEOUT );
 	}
 	return socket_globals.udp_phone;
@@ -426,4 +432,5 @@
 			return EPFNOSUPPORT;
 	}
+	if( phone < 0 ) return phone;
 	// create a new socket structure
 	socket = ( socket_ref ) malloc( sizeof( socket_t ));
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -45,4 +45,5 @@
 #include <ipc/services.h>
 
+#include <sys/time.h>
 #include <sys/types.h>
 
@@ -508,5 +509,5 @@
 }
 
-int icmp_connect_module( services_t service ){
+int icmp_connect_module( services_t service, suseconds_t timeout ){
 	icmp_echo_ref	echo_data;
 	icmp_param_t	id;
Index: uspace/srv/net/tl/icmp/icmp_common.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp_common.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/tl/icmp/icmp_common.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -45,8 +45,8 @@
 #include "icmp_messages.h"
 
-int icmp_connect_module( services_t service ){
+int icmp_connect_module( services_t service, suseconds_t timeout ){
 	int	phone;
 
-	phone = connect_to_service( SERVICE_ICMP );
+	phone = connect_to_service_timeout( SERVICE_ICMP, timeout );
 	if( phone >= 0 ){
 		async_req_0_0( phone, NET_ICMP_INIT );
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -219,8 +219,5 @@
 	fibril_rwlock_initialize( & tcp_globals.lock );
 	fibril_rwlock_write_lock( & tcp_globals.lock );
-	tcp_globals.icmp_phone = icmp_connect_module( SERVICE_ICMP );
-	if( tcp_globals.icmp_phone < 0 ){
-		return tcp_globals.icmp_phone;
-	}
+	tcp_globals.icmp_phone = icmp_connect_module( SERVICE_ICMP, ICMP_CONNECT_TIMEOUT );
 	tcp_globals.ip_phone = ip_bind_service( SERVICE_IP, IPPROTO_TCP, SERVICE_TCP, client_connection, tcp_received_msg );
 	if( tcp_globals.ip_phone < 0 ){
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision b648ae4bb0cb06a7ec37a14feca67b40c4f86490)
+++ uspace/srv/net/tl/udp/udp.c	(revision 1a0fb3f8aa71e3bb907eb17703615fc685752ca1)
@@ -198,8 +198,5 @@
 	fibril_rwlock_initialize( & udp_globals.lock );
 	fibril_rwlock_write_lock( & udp_globals.lock );
-	udp_globals.icmp_phone = icmp_connect_module( SERVICE_ICMP );
-	if( udp_globals.icmp_phone < 0 ){
-		return udp_globals.icmp_phone;
-	}
+	udp_globals.icmp_phone = icmp_connect_module( SERVICE_ICMP, ICMP_CONNECT_TIMEOUT );
 	udp_globals.ip_phone = ip_bind_service( SERVICE_IP, IPPROTO_UDP, SERVICE_UDP, client_connection, udp_received_msg );
 	if( udp_globals.ip_phone < 0 ){
