Skip to content

Client and server demonstrating concurrency in the transmission and handling of requests.

License

Notifications You must be signed in to change notification settings

EthanHannen/Multithreaded-Client-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Threaded Client and Server

Client and server demonstrating concurrency in the transmission and handling of requests.

Coding style is Allman layout with UpperCamelCase. This is just my preference for personal projects.

Screens

Client

alt text

Server

alt text

Build Strings

  • javac Client.java CClient.java ClientIO.java
  • javac Server.java ServerUtils.java ServerMessage.java ClientHandler.java

Runnables

  • Runnables are Client.java and Server.java.
  • When launching the server, a port must be supplied as an argument.

Client

The client will ask for an IP address and port when first launched. It will then ask for the command to be processed and the number of clients which to generate. The number of clients will determine how many times the command is sent to the server.

Available Commands:

  • Date - Get Date
  • Uptime - Get Uptime
  • Memory - Get Memory Usage
  • Status - Get Network Status
  • Users - Get List of Users
  • Process - Get Running Processes
  • Stop - Terminate Client & Server

Server

The server listens for traffic on a supplied port. Upon receive, it will accept the connection and create a new socket. From there, it will extract the Client Number from the first two bytes and the enumerated command from the last remaining bytes of the payload. If valid, it will execute the command in the linux shell and return the result to the client. Each request received will initialize a new ClientHandler object to process the request on a new thread.

Testing

The server is able to process several concurrent requests at once. Testing on a community university server revealed a considerable breakdown in server response after 25 concurrent connections. The goal of the project was to explore how well the server was able to handle multiple requests given 1, 5, 10, 15, 20, 25, and 100 concurrent connections.

alt text alt text alt text alt text alt text alt text

About

Client and server demonstrating concurrency in the transmission and handling of requests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages