Skip to content

SecBear/TCP-Client-Server-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

TCP-Client-Server

TCP Client and TCP Server written in C for Windows.

Introduction

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.

Purpose

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.

Prerequisites

Before running the code, ensure that you have the necessary development environment set up, including a C compiler.

Usage

TCP Client

The client program allows you to connect to a server and send messages for processing. To use the client:

  1. Compile the client source code using your C compiler.
  2. Run the compiled client executable, providing the server's hostname and port as command-line arguments.

Example:

./client <hostname> <port>
  1. Follow the prompts to enter a message, and the client will send it to the server.
  2. The server will process the message, and the client will display the server's response.

TCP Server

The server program listens for incoming client connections, processes the received messages, and sends back the reversed message. To use the server:

  1. Compile the server source code using your C compiler.
  2. 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.

  1. Connect a client to the server as explained in the client section.
  2. The server will receive the client's message, reverse it, and send back the reversed message to the client.
image image

About

TCP Client and TCP Server written in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages