Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 8fcf74fd5335a5f39aa5bfd787b0622a2999092d)
+++ uspace/Makefile	(revision 92e717c9d468d4db5d9376fe439bbfb40cb7f31e)
@@ -64,4 +64,5 @@
 	app/nettest1 \
 	app/nettest2 \
+	app/nettest3 \
 	app/ping \
 	app/websrv \
Index: uspace/app/netecho/netecho.c
===================================================================
--- uspace/app/netecho/netecho.c	(revision 8fcf74fd5335a5f39aa5bfd787b0622a2999092d)
+++ uspace/app/netecho/netecho.c	(revision 92e717c9d468d4db5d9376fe439bbfb40cb7f31e)
@@ -297,7 +297,13 @@
 
 			/* Answer the request either with the static reply or the original data */
-			rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen);
-			if (rc != EOK)
-				socket_print_error(stderr, rc, "Socket send: ", "\n");
+			if (type == SOCK_STREAM) {
+				rc = send(socket_id, reply ? reply : data, reply ? reply_length : length, 0);
+				if (rc != EOK)
+					socket_print_error(stderr, rc, "Socket send: ", "\n");
+			} else {
+				rc = sendto(socket_id, reply ? reply : data, reply ? reply_length : length, 0, address, addrlen);
+				if (rc != EOK)
+					socket_print_error(stderr, rc, "Socket send: ", "\n");
+			}
 		}
 
Index: uspace/app/nettest3/Makefile
===================================================================
--- uspace/app/nettest3/Makefile	(revision 92e717c9d468d4db5d9376fe439bbfb40cb7f31e)
+++ uspace/app/nettest3/Makefile	(revision 92e717c9d468d4db5d9376fe439bbfb40cb7f31e)
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2011 Jiri Svoboda
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+USPACE_PREFIX = ../..
+LIBS =
+EXTRA_CFLAGS =
+BINARY = nettest3
+
+SOURCES = \
+	nettest3.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/nettest3/nettest3.c
===================================================================
--- uspace/app/nettest3/nettest3.c	(revision 92e717c9d468d4db5d9376fe439bbfb40cb7f31e)
+++ uspace/app/nettest3/nettest3.c	(revision 92e717c9d468d4db5d9376fe439bbfb40cb7f31e)
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2011 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup nettest
+ * @{
+ */
+
+/** @file
+ * Networking test 3.
+ */
+
+#include <async.h>
+#include <stdio.h>
+#include <str.h>
+
+#include <net/in.h>
+#include <net/in6.h>
+#include <net/inet.h>
+#include <net/socket.h>
+
+#define BUF_SIZE 32
+
+static char *data;
+static size_t size;
+
+static char buf[BUF_SIZE];
+
+static struct sockaddr_in addr;
+
+static uint16_t port;
+
+int main(int argc, char *argv[])
+{
+	int rc;
+	int fd;
+
+	port = 80;
+
+	data = (char *)"Hello World!";
+	size = str_size(data);
+
+	addr.sin_family = AF_INET;
+	addr.sin_port = htons(port);
+	addr.sin_addr.s_addr = htonl(0x7f000001);
+
+	printf("socket()\n");
+	fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+	printf(" -> %d\n", fd);
+	if (fd < 0)
+		return 1;
+
+	printf("connect()\n");
+	rc = connect(fd, (struct sockaddr *)&addr, sizeof(addr));
+	printf(" -> %d\n", rc);
+	if (rc != 0)
+		return 1;
+
+	printf("send()\n");
+	rc = send(fd, data, size, 0);
+	printf(" -> %d\n", rc);
+	if (rc < 0)
+		return 1;
+
+	do {
+		printf("recv()\n");
+		rc = recv(fd, buf, BUF_SIZE, 0);
+		printf(" -> %d\n", rc);
+	} while (rc > 0);
+
+	async_usleep(15*1000*1000);
+
+	printf("closesocket()\n");
+	rc = closesocket(fd);
+	printf(" -> %d\n", rc);
+
+	return 0;
+}
+
+
+/** @}
+ */
