From 5626ba1525179d634676a347b5cd869cc3266090 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Thu, 1 Dec 2022 15:45:18 +0800 Subject: First commit --- client.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 client.c (limited to 'client.c') diff --git a/client.c b/client.c new file mode 100644 index 0000000..82c35a6 --- /dev/null +++ b/client.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int +main() +{ + int sockfd = socket(AF_INET, SOCK_STREAM, 0); + + struct sockaddr_in serv_addr; + bzero(&serv_addr, sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; + serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); + serv_addr.sin_port = htons(8888); + + connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)); +} -- cgit v1.2.3