Skip to content

This is a simple client-server application based on socket that can authenticate user and return pseudo market value using C language (Unix/Linux machine).

Notifications You must be signed in to change notification settings

ZhengguanLi/client-server-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client Server System

The client-server system is a socket programming application in C language (Linux environment) which implements a pair of client and server that can achieve simple password verification to indicate the current market value of the stock.

Usage

Compile

  • Server

    gcc server.c -o server.o
    
  • Client

    gcc client.c -o client.o
    

Run

  • Server

    ./server.o [port number]
    
  • Client

    ./client.o [IP address] [port number]
    

Running Test

  • Valid username and password

    • Server

      $./server.o 53598
      Socket created!
      Bind completed!
      --------------------------------
      Received username
      Received password
      Verified, sent back result
      
    • Client

      $ ./client.o 192/168.11.131 53598
      Socket created!
      Connection succeed!
      --------------------------------
      Please enter username: apple
      Please enter password: jP79bNs2
      The corresponding market value is: 158.63
      
  • Invalid username/password

    • Server

      $./server.o 53598
      Socket created!
      Bind completed!
      --------------------------------
      Received username
      Received password
      Username/password did not match
      
    • Client

      $ ./client.o 192/168.11.131 53598
      Socket created!
      Connection succeed!
      --------------------------------
      Please enter username: apple
      Please enter password: 123
      Username/password did not match!
      
  • Timeout for password

    • Server
      $./server.o 53598
      Socket created!
      Bind completed!
      --------------------------------
      Received username
      Timing out for password!
      
    • Client
      $ ./client.o 192/168.11.131 53598
      Socket created!
      Connection succeed!
      --------------------------------
      Please enter username: apple
      Please enter password: 123
      Verification message unreceived!
      

Authors

  • Zhengguan Li

About

This is a simple client-server application based on socket that can authenticate user and return pseudo market value using C language (Unix/Linux machine).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages