summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-01 23:12:41 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-01 23:12:41 +0200
commita239f9feadd015fa91d391df01365dcade8ce503 (patch)
tree979554817c2069a525e94e2ad5f6346b53e19eb5 /client.c
parent9f2fccfdc2eae83efbde1e3ae94a2cc220537983 (diff)
Threaded communication (icmpd)
Diffstat (limited to 'client.c')
-rw-r--r--client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/client.c b/client.c
index 4c1a32f..aa9b13c 100644
--- a/client.c
+++ b/client.c
@@ -20,10 +20,14 @@ int main(void) {
// const char *ip_address = "192.168.43.220";
// const char *ip_address = "198.211.118.67"; // tomsmeding.com
- struct icmp_client_incoming reply =
- icmp_client_communicate(sock, ip_address, 42, 1234, "kaashandel", 10);
+ if (icmp_client_send(sock, inet_addr(ip_address), 1234, "kaashandel", 10) < 0) {
+ perror("icmp_client_send");
+ return 1;
+ }
+
+ struct icmp_incoming reply = icmp_client_receive(sock);
if (reply.data == NULL) {
- perror("icmp_client_communicate");
+ perror("icmp_client_receive");
return 1;
}