FileServer - A multithreaded client-server program that uses Java Sockets to establish TCP/IP connection

Overview

Welcome to FileServer 👨‍💻 👋

FileServer is a multithreaded client-server program that uses TCP/IP connection for establshing a connection between a client and the server. It allows multiple clients to connect to and interact with the server simulataneously. The fileServer is a file storage program that allows the client to upload, fetch and delete files on/from the server. The file can be of any type text, image, video, audio, dmg, etc.

Table of contents

  1. Getting Started
  2. Demo
  3. Installation
  4. License
  5. Author

Getting started

The Server

FileServer consist of a multithreaded server that listens for incoming clients on the main thread and processes the client request on a separate pool of threads. This helps the server from not being occupied by the processing of the long running client request. And server will always be available for listening to new client request. Once the server process the client request, the server will generate a response and send it to the client.

and handles each client request on a separate thread.

The Client

The client sends a request to the server. And waits for the server response. After the server sends back a response the client displays an approriate message realated to the response to the user.

The client can send the different types of request to the server, which are as following:

  1. The client can send a request to upload a file on the servre.
  2. Client can also fetch a file from the server.
  3. Delete a file from the server.
  4. Client can also close its connection to the server.
  5. It can also send a request to shutdown server (In real world scenarios we don't do this :P)

Demo

Uploading files on the server

Upload.files.mov



Retrieving files from the server

Retrieve.mov



Deleting files from the server

Delete.mov



Invalid Client Request: For example retrieving/deleting (by file name or file ID) a file from the server that does not exist on the server. Or uploading a file on the server that does not exist on the client machine.

InvalidRequest.mov



Other user actions:

  1. Invalid user action
  2. Closing the client
  3. Shutting down the server
Exit.mov



Installation

From IDE:

  1. Download the project.
  2. Unzip it.
  3. Import the project to an IDE like IntelliJ IDEA, Microsoft Visual Studio or Eclipse.
  4. Build the project.
  5. Run the main file inside server folder to start the server.
  6. Run the main file inside client folder to start the client.
  7. You can also allow multiple instances of the client program to run.

From terminal:

  1. Open the project directory on terminal/command prompt.
  2. Move to the server folder and use the javac Main.java command to compile the server program.
  3. Move to the client folder and use the javac Main.java command to compile the client program.
  4. Use the java Main command to start the server.
  5. Use the java Main command to start the client.

Note: You need to have Java on your system to run this project.


License

Read more about the license here:
Apache License 2.0


Author

Lokesh Bisht

You might also like...

A simple Discord bot, which shows the server status of the Lost Ark server Beatrice

A simple Discord bot, which shows the server status of the Lost Ark server Beatrice

Beatrice A simple Discord bot, which shows the server status of the Lost Ark server Beatrice. Example Usage Clone the repository. Edit the property fi

Mar 9, 2022

Socket.IO server implemented on Java. Realtime java framework

Netty-socketio Overview This project is an open-source Java implementation of Socket.IO server. Based on Netty server framework. Checkout Demo project

Dec 30, 2022

Proteus Java Client

Netifi Proteus Java This project has been moved to https://github.com/netifi/netifi-java Build from Source Run the following Gradle command to build t

Nov 20, 2020

Socket.IO Client Implementation in Java

Socket.IO-Client for Java socket.io-java-client is an easy to use implementation of socket.io for Java. It uses Weberknecht as transport backend, but

Dec 21, 2022

Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.

Socket.IO-client Java This is the Socket.IO Client Library for Java, which is simply ported from the JavaScript client. See also: Android chat demo en

Jan 4, 2023

Asynchronous Http and WebSocket Client library for Java

Async Http Client Follow @AsyncHttpClient on Twitter. The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and a

Dec 31, 2022

Telegram API Client and Telegram BOT API Library and Framework in Pure java.

Javagram Telegram API Client and Telegram Bot API library and framework in pure Java. Hello Telegram You can use Javagram for both Telegram API Client

Oct 17, 2021

A Java event based WebSocket and HTTP server

Webbit - A Java event based WebSocket and HTTP server Getting it Prebuilt JARs are available from the central Maven repository or the Sonatype Maven r

Dec 23, 2022

HTTP Server Model made in java

SimplyJServer HTTP Server Model made in java Features Fast : SimplyJServer is 40%-60% faster than Apache, due to it's simplicity. Simple to implement

Sep 25, 2021
Owner
Lokesh Bisht
Lokesh Bisht
A small java project consisting of Client and Server, that communicate via TCP/UDP protocols.

Ninja Battle A small java project consisting of Client and Server, that communicate via TCP/UDP protocols. Client The client is equipped with a menu i

Steliyan Dobrev 2 Jan 14, 2022
A High Performance Network ( TCP/IP ) Library

Chronicle-Network About A High Performance Network library Purpose This library is designed to be lower latency and support higher throughputs by empl

Chronicle Software : Open Source 231 Dec 31, 2022
TCP/IP packet demultiplexer. Download from:

TCPFLOW 1.5.0 Downloads directory: http://digitalcorpora.org/downloads/tcpflow/ Installation Most common GNU/Linux distributions ship tcpflow in their

Simson L. Garfinkel 1.5k Jan 4, 2023
Magician is an asynchronous non-blocking network protocol analysis package, supports TCP, UDP protocol, built-in Http, WebSocket decoder

An asynchronous non-blocking network protocol analysis package Project Description Magician is an asynchronous non-blocking network protocol analysis

贝克街的天才 103 Nov 30, 2022
RSocket is a binary protocol for use on byte stream transports such as TCP, WebSockets, and Aeron

RSocket RSocket is a binary protocol for use on byte stream transports such as TCP, WebSockets, and Aeron. It enables the following symmetric interact

RSocket 2.2k Dec 30, 2022
A barebones WebSocket client and server implementation written in 100% Java.

Java WebSockets This repository contains a barebones WebSocket server and client implementation written in 100% Java. The underlying classes are imple

Nathan Rajlich 9.5k Dec 30, 2022
BAIN Social is a Fully Decentralized Server/client system that utilizes Concepts pioneered by I2P, ToR, and PGP to create a system which bypasses singular hosts for data while keeping that data secure.

SYNOPSIS ---------------------------------------------------------------------------------------------------- Welcome to B.A.I.N - Barren's A.I. Natio

Barren A.I. Wolfsbane 14 Jan 11, 2022
Book Finder application is a client-server application (gRPC) for educational purposes.

Book-Finder Book Finder application is a client-server application (gRPC) for educational purposes. Instalation These projects (Client/Server) are Mav

Mihai-Lucian Rîtan 21 Oct 27, 2022
Realtime Client Server Framework for the JVM, supporting WebSockets with Cross-Browser Fallbacks

Welcome to Atmosphere: The Event Driven Framework supporting WebSocket and HTTP The Atmosphere Framework contains client and server side components fo

Atmosphere Framework 3.6k Jan 3, 2023
A simple Socket program with GUI.

Socket A simple Socket program with GUI (by using swing). Suggest to open the folder 'Socket'(TCP) or 'SocketUDP' with IDEA There're 2 methods to run

Lu Yang 2 Sep 21, 2022