summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client-test.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/client-test.c b/client-test.c
new file mode 100644
index 0000000..1a8638d
--- /dev/null
+++ b/client-test.c
@@ -0,0 +1,29 @@
+#include <err.h>
+#include <errno.h>
+#include <poll.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+#define SOCK_PATH "/tmp/kissbot"
+
+int
+main(void) {
+	struct sockaddr_un remote = {.sun_family = AF_UNIX};
+	int s = socket(AF_UNIX, SOCK_STREAM, 0);
+	if (s == -1)
+		err(1, "socket");
+
+	strlcpy(remote.sun_path, SOCK_PATH,
+		sizeof(remote.sun_path)-1);
+	if (connect(s, (struct sockaddr *)&remote,
+		sizeof(SOCK_PATH) + sizeof(remote.sun_family)) == -1)
+		err(1, "connect");
+	char msg[] = "Hi, test message 1!\n";
+	if (send(s, msg, sizeof(msg), 0) == -1)
+		err(1, "send");
+	close(s);
+	return 0;
+}
ommitter Thomas E. Dickey <dickey@invisible-island.net> 2012-02-20 02:08:17 -0500 snapshot of project "lynx", label v2-8-8dev_11' href='/ingrix/lynx-snapshots/commit/lynx_help/keystrokes/bookmark_help.html?id=bc0fa578036583231edb567b328b4f69ce6860fe'>bc0fa578 ^
7c7d8c95 ^
bc0fa578 ^


7c7d8c95 ^


bc0fa578 ^

7c7d8c95 ^


bc0fa578 ^
7c7d8c95 ^
bc0fa578 ^
















7c7d8c95 ^





bc0fa578 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47