Index: uspace/lib/c/generic/inet/tcp.c
===================================================================
--- uspace/lib/c/generic/inet/tcp.c	(revision fab2746a5541d35bc79cbed917f66153231e4a4b)
+++ uspace/lib/c/generic/inet/tcp.c	(revision 779541be88a7692182b80bde3b7fae49f3832431)
@@ -30,5 +30,5 @@
  * @{
  */
-/** @file UDP API
+/** @file TCP API
  */
 
@@ -36,12 +36,82 @@
 #include <inet/endpoint.h>
 #include <inet/tcp.h>
+#include <ipc/services.h>
+#include <ipc/tcp.h>
+#include <stdlib.h>
+
+#include <stdio.h>
+
+static void tcp_cb_conn(ipc_callid_t, ipc_call_t *, void *);
+
+static int tcp_callback_create(tcp_t *tcp)
+{
+	async_exch_t *exch = async_exchange_begin(tcp->sess);
+
+	printf("tcp_callback_create()\n");
+
+	aid_t req = async_send_0(exch, TCP_CALLBACK_CREATE, NULL);
+	int rc = async_connect_to_me(exch, 0, 0, 0, tcp_cb_conn, tcp);
+	async_exchange_end(exch);
+
+	if (rc != EOK)
+		return rc;
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+
+	return retval;
+}
 
 int tcp_create(tcp_t **rtcp)
 {
-	return 0;
+	tcp_t *tcp;
+	service_id_t tcp_svcid;
+	int rc;
+
+	printf("tcp_create()\n");
+
+	tcp = calloc(1, sizeof(tcp_t));
+	if (tcp == NULL) {
+		rc = ENOMEM;
+		goto error;
+	}
+
+	list_initialize(&tcp->conn);
+	list_initialize(&tcp->listener);
+
+	rc = loc_service_get_id(SERVICE_NAME_TCP, &tcp_svcid,
+	    IPC_FLAG_BLOCKING);
+	if (rc != EOK) {
+		rc = EIO;
+		goto error;
+	}
+
+	tcp->sess = loc_service_connect(EXCHANGE_SERIALIZE, tcp_svcid,
+	    IPC_FLAG_BLOCKING);
+	if (tcp->sess == NULL) {
+		rc = EIO;
+		goto error;
+	}
+
+	rc = tcp_callback_create(tcp);
+	if (rc != EOK) {
+		rc = EIO;
+		goto error;
+	}
+
+	*rtcp = tcp;
+	return EOK;
+error:
+	free(tcp);
+	return rc;
 }
 
 void tcp_destroy(tcp_t *tcp)
 {
+	if (tcp == NULL)
+		return;
+
+	async_hangup(tcp->sess);
+	free(tcp);
 }
 
@@ -49,14 +119,84 @@
     tcp_conn_t **rconn)
 {
-	return 0;
+	async_exch_t *exch;
+	tcp_conn_t *conn;
+	ipc_call_t answer;
+
+	printf("tcp_conn_create()\n");
+
+	conn = calloc(1, sizeof(tcp_conn_t));
+	if (conn == NULL)
+		return ENOMEM;
+
+	conn->data_avail = false;
+	fibril_mutex_initialize(&conn->lock);
+	fibril_condvar_initialize(&conn->cv);
+
+	exch = async_exchange_begin(tcp->sess);
+	aid_t req = async_send_0(exch, TCP_CONN_CREATE, &answer);
+	sysarg_t rc = async_data_write_start(exch, (void *)epp,
+	    sizeof(inet_ep2_t));
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		sysarg_t rc_orig;
+		async_wait_for(req, &rc_orig);
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		goto error;
+	}
+
+	async_wait_for(req, &rc);
+	if (rc != EOK)
+		goto error;
+
+	conn->tcp = tcp;
+	conn->id = IPC_GET_ARG1(answer);
+	conn->cb = cb;
+	conn->cb_arg = arg;
+
+	list_append(&conn->ltcp, &tcp->conn);
+	*rconn = conn;
+
+	return EOK;
+error:
+	free(conn);
+	return (int) rc;
 }
 
 void tcp_conn_destroy(tcp_conn_t *conn)
 {
+	async_exch_t *exch;
+
+	printf("tcp_conn_destroy()\n");
+
+	if (conn == NULL)
+		return;
+
+	list_remove(&conn->ltcp);
+
+	exch = async_exchange_begin(conn->tcp->sess);
+	sysarg_t rc = async_req_1_0(exch, TCP_CONN_DESTROY, conn->id);
+	async_exchange_end(exch);
+
+	free(conn);
+	(void) rc;
+}
+
+static int tcp_conn_get(tcp_t *tcp, sysarg_t id, tcp_conn_t **rconn)
+{
+	list_foreach(tcp->conn, ltcp, tcp_conn_t, conn) {
+		if (conn->id == id) {
+			*rconn = conn;
+			return EOK;
+		}
+	}
+
+	return EINVAL;
 }
 
 void *tcp_conn_userptr(tcp_conn_t *conn)
 {
-	return NULL;
+	return conn->cb_arg;
 }
 
@@ -64,50 +204,327 @@
     void *larg, tcp_cb_t *cb, void *arg, tcp_listener_t **rlst)
 {
+	async_exch_t *exch;
+	tcp_listener_t *lst;
+	ipc_call_t answer;
+
+	printf("tcp_listener_create()\n");
+
+	lst = calloc(1, sizeof(tcp_listener_t));
+	if (lst == NULL)
+		return ENOMEM;
+
+	exch = async_exchange_begin(tcp->sess);
+	aid_t req = async_send_0(exch, TCP_LISTENER_CREATE, &answer);
+	sysarg_t rc = async_data_write_start(exch, (void *)ep,
+	    sizeof(inet_ep_t));
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		sysarg_t rc_orig;
+		async_wait_for(req, &rc_orig);
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		goto error;
+	}
+
+	async_wait_for(req, &rc);
+	if (rc != EOK)
+		goto error;
+
+	lst->tcp = tcp;
+	lst->id = IPC_GET_ARG1(answer);
+	lst->lcb = lcb;
+	lst->lcb_arg = larg;
+	lst->cb = cb;
+	lst->cb_arg = arg;
+
+	list_append(&lst->ltcp, &tcp->listener);
+	*rlst = lst;
+
+	return EOK;
+error:
+	free(lst);
+	return (int) rc;
+}
+
+void tcp_listener_destroy(tcp_listener_t *lst)
+{
+	async_exch_t *exch;
+
+	printf("tcp_listener_destroy()\n");
+
+	if (lst == NULL)
+		return;
+
+	list_remove(&lst->ltcp);
+
+	exch = async_exchange_begin(lst->tcp->sess);
+	sysarg_t rc = async_req_1_0(exch, TCP_LISTENER_DESTROY, lst->id);
+	async_exchange_end(exch);
+
+	free(lst);
+	(void) rc;
+}
+
+void *tcp_listener_userptr(tcp_listener_t *lst)
+{
+	return lst->lcb_arg;
+}
+
+int tcp_conn_wait_connected(tcp_conn_t *conn)
+{
+	async_usleep(1000 * 1000);
 	return 0;
 }
 
-void tcp_listener_destroy(tcp_listener_t *lst)
-{
-}
-
-void *tcp_listener_userptr(tcp_listener_t *lst)
-{
-	return NULL;
-}
-
-
-int tcp_conn_wait_connected(tcp_conn_t *conn)
-{
-	return 0;
-}
-
 int tcp_conn_send(tcp_conn_t *conn, const void *data, size_t bytes)
 {
-	return 0;
-}
+	async_exch_t *exch;
+	sysarg_t rc;
+
+	printf("tcp_conn_send()\n");
+
+	exch = async_exchange_begin(conn->tcp->sess);
+	aid_t req = async_send_1(exch, TCP_CONN_SEND, conn->id, NULL);
+
+	rc = async_data_write_start(exch, data, bytes);
+	if (rc != EOK) {
+		async_forget(req);
+		return rc;
+	}
+
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		async_forget(req);
+		return rc;
+	}
+
+	async_wait_for(req, &rc);
+	return rc;
+}
+
 
 int tcp_conn_send_fin(tcp_conn_t *conn)
 {
-	return 0;
+	async_exch_t *exch;
+
+	printf("tcp_conn_send_fin()\n");
+
+	exch = async_exchange_begin(conn->tcp->sess);
+	sysarg_t rc = async_req_1_0(exch, TCP_CONN_SEND_FIN, conn->id);
+	async_exchange_end(exch);
+
+	return rc;
 }
 
 int tcp_conn_push(tcp_conn_t *conn)
 {
-	return 0;
-}
-
-void tcp_conn_reset(tcp_conn_t *conn)
-{
-}
-
+	async_exch_t *exch;
+
+	printf("tcp_conn_push()\n");
+
+	exch = async_exchange_begin(conn->tcp->sess);
+	sysarg_t rc = async_req_1_0(exch, TCP_CONN_PUSH, conn->id);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+int tcp_conn_reset(tcp_conn_t *conn)
+{
+	async_exch_t *exch;
+
+	printf("tcp_conn_reset()\n");
+
+	exch = async_exchange_begin(conn->tcp->sess);
+	sysarg_t rc = async_req_1_0(exch, TCP_CONN_RESET, conn->id);
+	async_exchange_end(exch);
+
+	return rc;
+}
 
 int tcp_conn_recv(tcp_conn_t *conn, void *buf, size_t bsize, size_t *nrecv)
 {
-	return 0;
+	async_exch_t *exch;
+	ipc_call_t answer;
+
+	printf("tcp_conn_recv() bsize=%zu\n", bsize);
+
+	fibril_mutex_lock(&conn->lock);
+	if (!conn->data_avail) {
+		printf("returning EAGAIN\n");
+		fibril_mutex_unlock(&conn->lock);
+		return EAGAIN;
+	}
+
+	exch = async_exchange_begin(conn->tcp->sess);
+	aid_t req = async_send_1(exch, TCP_CONN_RECV, conn->id, &answer);
+	int rc = async_data_read_start(exch, buf, bsize);
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		printf("got rc = %d\n", rc);
+		async_forget(req);
+		fibril_mutex_unlock(&conn->lock);
+		return rc;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+	if (retval != EOK) {
+		printf("got rc = %d\n", rc);
+		fibril_mutex_unlock(&conn->lock);
+		return retval;
+	}
+
+	*nrecv = IPC_GET_ARG1(answer);
+	fibril_mutex_unlock(&conn->lock);
+	return EOK;
 }
 
 int tcp_conn_recv_wait(tcp_conn_t *conn, void *buf, size_t bsize, size_t *nrecv)
 {
-	return 0;
+	async_exch_t *exch;
+	ipc_call_t answer;
+
+	printf("tcp_conn_recv_wait() bsize=%zu\n", bsize);
+again:
+	fibril_mutex_lock(&conn->lock);
+	while (!conn->data_avail) {
+		printf("wait for data to be avail\n");
+		fibril_condvar_wait(&conn->cv, &conn->lock);
+	}
+
+	printf("tcp_conn_recv_wait - get data\n");
+	exch = async_exchange_begin(conn->tcp->sess);
+	aid_t req = async_send_1(exch, TCP_CONN_RECV_WAIT, conn->id, &answer);
+	int rc = async_data_read_start(exch, buf, bsize);
+	printf("tcp_conn_recv_wait - rc = %d\n", rc);
+	async_exchange_end(exch);
+
+	if (rc != EOK) {
+		printf("got rc=%d\n", rc);
+		async_forget(req);
+		if (rc == EAGAIN) {
+			conn->data_avail = false;
+			fibril_mutex_unlock(&conn->lock);
+			goto again;
+		}
+		fibril_mutex_unlock(&conn->lock);
+		return rc;
+	}
+
+	sysarg_t retval;
+	async_wait_for(req, &retval);
+	if (retval != EOK) {
+		printf("got retval != EOK\n");
+		if (rc == EAGAIN) {
+			printf("rc == EAGAIN\n");
+			conn->data_avail = false;
+		}
+		fibril_mutex_unlock(&conn->lock);
+		return retval;
+	}
+
+	*nrecv = IPC_GET_ARG1(answer);
+	fibril_mutex_unlock(&conn->lock);
+	printf("tcp_conn_recv_wait: nrecv=%zu\n", *nrecv);
+	printf("received: '");
+	size_t i;
+	for (i = 0; i < *nrecv; i++) {
+		putchar((char)((char *)buf)[i]);
+	}
+	printf("'\n");
+	return EOK;
+}
+
+static void tcp_ev_connected(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
+{
+	printf("tcp_ev_connected()\n");
+	async_answer_0(iid, ENOTSUP);
+}
+
+static void tcp_ev_conn_failed(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
+{
+	printf("tcp_ev_conn_failed()\n");
+	async_answer_0(iid, ENOTSUP);
+}
+
+static void tcp_ev_conn_reset(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
+{
+	printf("tcp_ev_conn_reset()\n");
+	async_answer_0(iid, ENOTSUP);
+}
+
+static void tcp_ev_data(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
+{
+	tcp_conn_t *conn;
+	sysarg_t conn_id;
+	int rc;
+
+	printf("tcp_ev_data()\n");
+	conn_id = IPC_GET_ARG1(*icall);
+
+	rc = tcp_conn_get(tcp, conn_id, &conn);
+	if (rc != EOK) {
+		printf("conn ID %zu not found\n",
+		    conn_id);
+		async_answer_0(iid, ENOENT);
+		return;
+	}
+
+	conn->data_avail = true;
+	fibril_condvar_broadcast(&conn->cv);
+
+	async_answer_0(iid, EOK);
+}
+
+static void tcp_ev_urg_data(tcp_t *tcp, ipc_callid_t iid, ipc_call_t *icall)
+{
+	printf("tcp_ev_urg_data()\n");
+	async_answer_0(iid, ENOTSUP);
+}
+
+static void tcp_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
+{
+	tcp_t *tcp = (tcp_t *)arg;
+
+	async_answer_0(iid, EOK);
+
+	printf("tcp_cb_conn()\n");
+
+	while (true) {
+		ipc_call_t call;
+		ipc_callid_t callid = async_get_call(&call);
+
+		printf("tcp_cb_conn() - msg %d\n",
+		    (int)IPC_GET_IMETHOD(call));
+		if (!IPC_GET_IMETHOD(call)) {
+			/* TODO: Handle hangup */
+			return;
+		}
+
+		switch (IPC_GET_IMETHOD(call)) {
+		case TCP_EV_CONNECTED:
+			tcp_ev_connected(tcp, callid, &call);
+			break;
+		case TCP_EV_CONN_FAILED:
+			tcp_ev_conn_failed(tcp, callid, &call);
+			break;
+		case TCP_EV_CONN_RESET:
+			tcp_ev_conn_reset(tcp, callid, &call);
+			break;
+		case TCP_EV_DATA:
+			tcp_ev_data(tcp, callid, &call);
+			break;
+		case TCP_EV_URG_DATA:
+			tcp_ev_urg_data(tcp, callid, &call);
+			break;
+		default:
+			async_answer_0(callid, ENOTSUP);
+			break;
+		}
+	}
 }
 
Index: uspace/lib/c/generic/inet/udp.c
===================================================================
--- uspace/lib/c/generic/inet/udp.c	(revision fab2746a5541d35bc79cbed917f66153231e4a4b)
+++ uspace/lib/c/generic/inet/udp.c	(revision 779541be88a7692182b80bde3b7fae49f3832431)
@@ -42,6 +42,4 @@
 #include <stdlib.h>
 
-#include <stdio.h>
-
 static void udp_cb_conn(ipc_callid_t, ipc_call_t *, void *);
 
@@ -50,5 +48,5 @@
 	async_exch_t *exch = async_exchange_begin(udp->sess);
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_callback_create()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_callback_create()");
 
 	aid_t req = async_send_0(exch, UDP_CALLBACK_CREATE, NULL);
@@ -71,5 +69,5 @@
 	int rc;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_create()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_create()");
 
 	udp = calloc(1, sizeof(udp_t));
@@ -124,5 +122,5 @@
 	ipc_call_t answer;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_create()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_create()");
 
 	assoc = calloc(1, sizeof(udp_assoc_t));
@@ -166,5 +164,5 @@
 	async_exch_t *exch;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_destroy()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_destroy()");
 
 	if (assoc == NULL)
@@ -186,5 +184,5 @@
 	async_exch_t *exch;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_send_msg()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_send_msg()");
 
 	exch = async_exchange_begin(assoc->udp->sess);
@@ -277,5 +275,5 @@
 	ipc_call_t answer;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_info()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_info()");
 
 	exch = async_exchange_begin(udp->sess);
@@ -305,5 +303,5 @@
 	async_exch_t *exch;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_discard()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_rmsg_discard()");
 
 	exch = async_exchange_begin(udp->sess);
@@ -332,10 +330,10 @@
 	int rc;
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_ev_data()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_ev_data()");
 
 	while (true) {
 		rc = udp_rmsg_info(udp, &rmsg);
 		if (rc != EOK) {
-			log_msg(LOG_DEFAULT, LVL_NOTE, "Error getting message info\n");
+			log_msg(LOG_DEFAULT, LVL_NOTE, "Error getting message info");
 			break;
 		}
@@ -343,5 +341,5 @@
 		rc = udp_assoc_get(udp, rmsg.assoc_id, &assoc);
 		if (rc != EOK) {
-			log_msg(LOG_DEFAULT, LVL_NOTE, "assoc ID %zu not found\n",
+			log_msg(LOG_DEFAULT, LVL_NOTE, "assoc ID %zu not found",
 			    rmsg.assoc_id);
 			continue;
@@ -353,5 +351,5 @@
 		rc = udp_rmsg_discard(udp);
 		if (rc != EOK) {
-			log_msg(LOG_DEFAULT, LVL_NOTE, "Error discarding message\n");
+			log_msg(LOG_DEFAULT, LVL_NOTE, "Error discarding message");
 			break;
 		}
@@ -367,5 +365,5 @@
 	async_answer_0(iid, EOK);
 
-	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_cb_conn()\n");
+	log_msg(LOG_DEFAULT, LVL_NOTE, "udp_cb_conn()");
 
 	while (true) {
@@ -373,5 +371,5 @@
 		ipc_callid_t callid = async_get_call(&call);
 
-		log_msg(LOG_DEFAULT, LVL_NOTE, "udp_cb_conn() - msg %d\n",
+		log_msg(LOG_DEFAULT, LVL_NOTE, "udp_cb_conn() - msg %d",
 		    (int)IPC_GET_IMETHOD(call));
 		if (!IPC_GET_IMETHOD(call)) {
Index: uspace/lib/c/include/inet/tcp.h
===================================================================
--- uspace/lib/c/include/inet/tcp.h	(revision fab2746a5541d35bc79cbed917f66153231e4a4b)
+++ uspace/lib/c/include/inet/tcp.h	(revision 779541be88a7692182b80bde3b7fae49f3832431)
@@ -36,15 +36,35 @@
 #define LIBC_INET_TCP_H_
 
+#include <fibril_synch.h>
 #include <inet/addr.h>
 #include <inet/endpoint.h>
 #include <inet/inet.h>
 
+/** TCP connection */
 typedef struct {
+	fibril_mutex_t lock;
+	fibril_condvar_t cv;
+	struct tcp *tcp;
+	link_t ltcp;
+	sysarg_t id;
+	struct tcp_cb *cb;
+	void *cb_arg;
+	/** Some received data available in TCP server */
+	bool data_avail;
 } tcp_conn_t;
 
+/** TCP connection listener */
 typedef struct {
+	struct tcp *tcp;
+	link_t ltcp;
+	sysarg_t id;
+	struct tcp_listen_cb *lcb;
+	void *lcb_arg;
+	struct tcp_cb *cb;
+	void *cb_arg;
 } tcp_listener_t;
 
-typedef struct {
+/** TCP connection callbacks */
+typedef struct tcp_cb {
 	void (*connected)(tcp_conn_t *);
 	void (*conn_failed)(tcp_conn_t *);
@@ -54,9 +74,17 @@
 } tcp_cb_t;
 
-typedef struct {
+/** TCP listener callbacks */
+typedef struct tcp_listen_cb {
 	void (*new_conn)(tcp_listener_t *, tcp_conn_t *);
 } tcp_listen_cb_t;
 
-typedef struct {
+/** TCP service */
+typedef struct tcp {
+	/** TCP session */
+	async_sess_t *sess;
+	/** List of connections */
+	list_t conn; /* of tcp_conn_t */
+	/** List of listeners */
+	list_t listener; /* of tcp_listener_t */
 } tcp_t;
 
@@ -76,5 +104,5 @@
 extern int tcp_conn_send_fin(tcp_conn_t *);
 extern int tcp_conn_push(tcp_conn_t *);
-extern void tcp_conn_reset(tcp_conn_t *);
+extern int tcp_conn_reset(tcp_conn_t *);
 
 extern int tcp_conn_recv(tcp_conn_t *, void *, size_t, size_t *);
Index: uspace/lib/c/include/inet/udp.h
===================================================================
--- uspace/lib/c/include/inet/udp.h	(revision fab2746a5541d35bc79cbed917f66153231e4a4b)
+++ uspace/lib/c/include/inet/udp.h	(revision 779541be88a7692182b80bde3b7fae49f3832431)
@@ -41,4 +41,5 @@
 #include <inet/inet.h>
 
+/** UDP link state */
 typedef enum {
 	udp_ls_down,
@@ -46,4 +47,5 @@
 } udp_link_state_t;
 
+/** UDP received message */
 typedef struct {
 	struct udp *udp;
@@ -53,7 +55,9 @@
 } udp_rmsg_t;
 
+/** UDP received error */
 typedef struct {
 } udp_rerr_t;
 
+/** UDP association */
 typedef struct {
 	struct udp *udp;
@@ -64,4 +68,5 @@
 } udp_assoc_t;
 
+/** UDP callbacks */
 typedef struct udp_cb {
 	void (*recv_msg)(udp_assoc_t *, udp_rmsg_t *);
@@ -70,4 +75,5 @@
 } udp_cb_t;
 
+/** UDP service */
 typedef struct udp {
 	/** UDP session */
Index: uspace/lib/c/include/ipc/tcp.h
===================================================================
--- uspace/lib/c/include/ipc/tcp.h	(revision fab2746a5541d35bc79cbed917f66153231e4a4b)
+++ uspace/lib/c/include/ipc/tcp.h	(revision 779541be88a7692182b80bde3b7fae49f3832431)
@@ -39,5 +39,6 @@
 
 typedef enum {
-	TCP_CONN_CREATE = IPC_FIRST_USER_METHOD,
+	TCP_CALLBACK_CREATE = IPC_FIRST_USER_METHOD,
+	TCP_CONN_CREATE,
 	TCP_CONN_DESTROY,
 	TCP_LISTENER_CREATE,
@@ -47,18 +48,19 @@
 	TCP_CONN_PUSH,
 	TCP_CONN_RESET,
-	TCP_CONN_RECV
+	TCP_CONN_RECV,
+	TCP_CONN_RECV_WAIT
 } tcp_request_t;
 
 typedef enum {
-	TCP_CONNECTED = IPC_FIRST_USER_METHOD
-	TCP_CONN_FAILED,
-	TCP_CONN_RESET,
-	TCP_DATA_AVAIL,
-	TCP_URG_DATA
-} tcp_notif_t;
+	TCP_EV_CONNECTED = IPC_FIRST_USER_METHOD,
+	TCP_EV_CONN_FAILED,
+	TCP_EV_CONN_RESET,
+	TCP_EV_DATA,
+	TCP_EV_URG_DATA
+} tcp_event_t;
 
 typedef enum {
-	TCP_NEW_CONN = IPC_FIRST_USER_METHOD
-} tcp_listen_cb_t;
+	TCP_LEV_NEW_CONN = IPC_FIRST_USER_METHOD
+} tcp_listen_event_t;
 
 #endif
Index: uspace/lib/http/src/http.c
===================================================================
--- uspace/lib/http/src/http.c	(revision fab2746a5541d35bc79cbed917f66153231e4a4b)
+++ uspace/lib/http/src/http.c	(revision 779541be88a7692182b80bde3b7fae49f3832431)
@@ -52,5 +52,5 @@
 	int rc;
 
-	rc = tcp_conn_recv(http->conn, buf, buf_size, &nrecv);
+	rc = tcp_conn_recv_wait(http->conn, buf, buf_size, &nrecv);
 	if (rc != EOK)
 		return rc;
