ucase_tcp
The following are a server and client program that demonstrate TCP
sockets. The client reads a line of text from stdin and sends this line
to the server; the server than capitalizes the line and sends it back to
the client, who prints this line. Once the user hits CTRL-d,
the client closes its connection.
- server: ucase_tcp_server.c
- client: ucase_tcp_client.c
- common: common.h, common.c
- Implements read_line, which both the server and client use to read a line of data from a socket.
- mu: mu.h, mu.c
- mu_init_sockaddr_in: initialize a struct sockaddr_in from a string IPv4 address and string port number.
- mu_reusaddr: set the SO_REUSEADDR on a server's TCP socket so that we can immediately re-start the program and re-bind to the same socket in the event that
the server crashes or otherwise abruptly stops.
- Makefile
ucase_tcp_server.c
ucase_tcp_client.c
common.h
common.c
mu.h
mu.c
Makefile