Skip to content

Samyang7/MultiClient_Server_communication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project description

Implementing a simple version of online videoconferencing and messaging application based on a client server model consisting of one server and multiple clients communicating concurrently. The text messages were communicated using TCP for the reason of reliability, while the video (we will use video files instead of capturing the live video streams from cameras and microphones) was communicated using UDP for the reason of low latency. application supported a range of functions that are typically found on videoconferencing including authentication, posting text message to all participants or one particular participant, uploading video streams.

General functionality

The client program initiates a TCP connection with the server. Upon connection establishment, the user will initiate the authentication process. The client will interact with the user through the command line interface. Following successful authentication, the user can initiate one of the available commands. All commands require a simple request response interaction between the client and server or two clients. The user can execute a series of commands (one after the other) and eventually quit. Both the client and server print meaningful messages at the command prompt that capture the specific interactions taking place.

Detail supported function

Authentication

When a client requests for a connection to the server, e.g., for attending a video conference, the server prompt the user to input the username and password and authenticate the user. The valid username and password combinations will be stored in a file called credentials.txt which will be in the same directory as the server program.

  • If the credentials are correct, the client is considered to be logged in and a welcome message is displayed.
  • On entering invalid credentials, the user is prompted to retry. After a number of consecutive failed attempts, the user is blocked for a duration of 10 seconds and cannot login during this 10 second duration (even from another IP address).

Text Message operation

Following successful login, the client displays a message to the user informing them of all available commands and prompting to select one command. The following commands(terminal) are available. All available commands are showing to the user in the first instance after successful login. If an invalid command is selected, an error message is shown to the user and they will be prompted to select one of the available actions.

  • MSG: Post Message -> messagenumber; timestamp; username; message; edited
  • DLT: Delete Message -> DLT messagenumber timestamp
  • EDT: Edit Message -> EDT messagenunmber timestamp message
  • RDM: Read Message -> RDM timestamp
  • ATU: Display active users -> ATU
  • OUT: Log out -> OUT
  • UPD: Upload file -> UPD username filename

Peer to Peer Communication(video file upload)

The P2P enables one client upload video files to another client using UDP. Each client is in one of two states, Presenter or Audience. The Presenter client sends video files the Audience client. Here, the presenter client is the UDP client, while the Audience client is the UDP server. After receiving the video files, the Audience client saves the files and the username of Presenter. a client can behave in either Presenter or Audience state.

  • UPD: Upload file -> UPD username filename

Progragmming language

Java

How to use

clone the file to the local computer and run the client.java and server.java file. Running the Server executable file first to open the server and Client executeable to initiate the connection between the server. When testing, you can run the server and multiple clients on the same machine on separate terminals. In this case, use 127.0.0.1 (local host) as the server IP address.

example command for server.java:

  • java Server server_port number_of_consecutive_failed_attempts

example command for client.java:

  • java Client server_IP server_port client_udp_server_port

The additional argument of client_udp_server_port is for the P2P UDP communication. In UDP P2P communication, one client program (i.e., Audience) acts as UDP server and the other client program (i.e., Presenter) acts as UDP client.

Example interaction

Yoda termainl and Hans termminal was runned by client.java file and server terminal was runned by server.java file. the video file is under the same directory as client and server file. Screen Shot 2021-08-25 at 14 03 21

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages