TCP Client and TCP Server written in C for Windows.
This project demonstrates a simple client-server communication system implemented in C. The client and server can exchange messages, and the server performs a string reversal operation on the received data.
I developed this project as part of my CYBV 310 - Intro to Security Programming I course at the University of Arizona. The purpose is to provide a basic example of network communication.
Before running the code, ensure that you have the necessary development environment set up, including a C compiler.
The client program allows you to connect to a server and send messages for processing. To use the client:
- Compile the client source code using your C compiler.
- Run the compiled client executable, providing the server's hostname and port as command-line arguments.
Example:
./client <hostname> <port>- Follow the prompts to enter a message, and the client will send it to the server.
- The server will process the message, and the client will display the server's response.
The server program listens for incoming client connections, processes the received messages, and sends back the reversed message. To use the server:
- Compile the server source code using your C compiler.
- Run the compiled server executable, providing the port to listen on as a command-line argument.
Example:
./server <port>The server will start listening for incoming client connections.
- Connect a client to the server as explained in the client section.
- The server will receive the client's message, reverse it, and send back the reversed message to the client.