summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-28 08:39:48 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-28 08:39:48 -0600
commit0c2fbe6e8fd903f562fd092892990f8ebeadc0a7 (patch)
treefa06094118b790c661ab4a81340a9dc4dc38a945 /apps
parent94cc8d63622caad406be864d21bde2fc9ca9e886 (diff)
downloadnuttx-0c2fbe6e8fd903f562fd092892990f8ebeadc0a7.tar.gz
nuttx-0c2fbe6e8fd903f562fd092892990f8ebeadc0a7.tar.bz2
nuttx-0c2fbe6e8fd903f562fd092892990f8ebeadc0a7.zip
Unix domain: More fixes. With these changes, apps/examples/ustream works
Diffstat (limited to 'apps')
-rw-r--r--apps/examples/ustream/ustream_client.c3
-rw-r--r--apps/examples/ustream/ustream_server.c12
2 files changed, 5 insertions, 10 deletions
diff --git a/apps/examples/ustream/ustream_client.c b/apps/examples/ustream/ustream_client.c
index 797a5a18c..b09e9558b 100644
--- a/apps/examples/ustream/ustream_client.c
+++ b/apps/examples/ustream/ustream_client.c
@@ -103,7 +103,7 @@ int client_main(int argc, char *argv[])
strncpy(myaddr.sun_path, CONFIG_EXAMPLES_USTREAM_ADDR, addrlen);
myaddr.sun_path[addrlen] = '\0';
- printf("client: Connecting...\n");
+ printf("client: Connecting to %s...\n", CONFIG_EXAMPLES_USTREAM_ADDR);
addrlen += sizeof(sa_family_t) + 1;
ret = connect( sockfd, (struct sockaddr *)&myaddr, addrlen);
if (ret < 0)
@@ -176,6 +176,7 @@ int client_main(int argc, char *argv[])
goto errout_with_socket;
}
+ printf("client: Terminating\n");
close(sockfd);
free(outbuf);
free(inbuf);
diff --git a/apps/examples/ustream/ustream_server.c b/apps/examples/ustream/ustream_server.c
index 4432019a4..0bd8467f0 100644
--- a/apps/examples/ustream/ustream_server.c
+++ b/apps/examples/ustream/ustream_server.c
@@ -113,6 +113,8 @@ int server_main(int argc, char *argv[])
/* Listen for connections on the bound socket */
+ printf("server: Accepting connections on %s ...\n", CONFIG_EXAMPLES_USTREAM_ADDR);
+
if (listen(listensd, 5) < 0)
{
printf("server: listen failure %d\n", errno);
@@ -121,7 +123,6 @@ int server_main(int argc, char *argv[])
/* Accept only one connection */
- printf("server: Accepting connections on %s\n", CONFIG_EXAMPLES_USTREAM_ADDR);
acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen);
if (acceptsd < 0)
{
@@ -187,14 +188,7 @@ int server_main(int argc, char *argv[])
}
printf("server: Sent %d bytes\n", nbytessent);
-
- /* If this platform only does abortive disconnects, then wait a bit to get the
- * client side a change to receive the data.
- */
-
- printf("server: Wait before closing\n");
- sleep(60);
-
+ printf("server: Terminating\n");
close(listensd);
close(acceptsd);
free(buffer);