Skip to content

Instantly share code, notes, and snippets.

View Josh798's full-sized avatar

Joshua Ackley Josh798

  • Battelle Memorial Institute
  • Columbus, OH
View GitHub Profile
@Josh798
Josh798 / open_server_socket.c
Created November 22, 2020 17:45
Open a server socket at which TCP connections may be accepted.
#include <stdio.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
/**
@Josh798
Josh798 / connect_to_server.c
Created August 14, 2020 21:56
Simple TCP client connection (in C)
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>