summaryrefslogtreecommitdiff
path: root/tcpstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcpstat.c')
-rw-r--r--tcpstat.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tcpstat.c b/tcpstat.c
index b76877f..ff24848 100644
--- a/tcpstat.c
+++ b/tcpstat.c
@@ -9,6 +9,8 @@
#include "debug.h"
#include "data.h"
+#define COMMAND "list\nbye\n"
+
static char buf[0x1000];
int main(int argc, char *argv[])
@@ -27,6 +29,9 @@ int main(int argc, char *argv[])
if (connect(sock, (struct sockaddr *) &sa, sizeof(sa)) < 0)
sys_err("connect");
+ if (write(sock, COMMAND, sizeof(COMMAND) - 1) < 0)
+ sys_err("write");
+
while ((n = read(sock, buf, sizeof(buf))) > 0) {
buf[n] = 0;
fputs(buf, stdout);