Skip to content

A simple Linux based client/server socket application written on C.

Notifications You must be signed in to change notification settings

Christinahak/server-client-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server-Client Application

A simple Linux-based client/server socket application implemented in C. The server handles up to 5 clients simultaneously and supports basic command handling, including execution of some Linux commands.

Server Features

  • Client Limit: Allows a maximum of 5 clients to connect simultaneously.
  • Command Handler:
    • disconnect: Closes the connection with the client.
    • shell "COMMAND": Executes the specified command on the server and sends the output back to the client. Supports basic Linux commands.

Client Features

  • Command-Line Interface: Provides commands to interact with the server.
  • Supported Commands:
    • connect <IP_ADDRESS> <PORT>: Connects to the server at the specified IP address and port.
    • disconnect: Disconnects from the server.
    • shell "COMMAND": Sends a shell command to the server and displays the response.

Usage

  1. Compile the Program: Run the command make in the terminal.
    make
  2. Start the Server: Run the server with the command ./server <port_number>, where <port_number> is a 4-digit number.
    ./server 3000
  3. Start the Client: Open a new terminal and run the client with the command ./client.
    ./client
    

Commands

  1. Connecting to the Server
  • Type connect <IP_ADDRESS> <PORT> in the client terminal.
    connect 127.0.0.1 3000
    
  1. Disconnecting from the Server
  • Type disconnect in the client terminal.
    disconnect
    
  1. Sending a shell command
  • Type shell "COMMAND"
    shell "pwd"

About

A simple Linux based client/server socket application written on C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published