Coder Social home page Coder Social logo

arjunagi / client-server--java-udp-sockets Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 4.0 196 KB

A Java application that enables reliable data transfer between a server and a client over the UDP protocol. The application has a customized acknowledgement mechanism and integrity check algorithm in order to ensure the reliable data transfer and data security over UDP.

Java 100.00%
java junit-test udp-protocol mockito-framework powermock

client-server--java-udp-sockets's Introduction

Client-Server----Java-UDP-Sockets

A Java program that enables reliable data transfer between a server and a client over the UDP protocol. The application has a customized acknowledgement mechanism and integrity check algorithm in order to ensure the reliable data transfer and data security over UDP. The client requests for the contents of one of the files available at the server. The server responds with the contents, if present, or sends the appropriate error message.

Executing the application:

You will need two separate instances(workspaces) of Eclipse to execute this application - one for Client and other for Server. Create seperate projects for the client and server packages and add the Client.java and Server.java files in respective src folders of the projects. Then follow the below steps:

  1. Create 3 files file_A.txt, file_B.txt and file_C.txt.
  2. Add the path of these files in Server.java file (line 165)
  3. Add the ClientServerUtility.java file in the source folders of server and client packages. This utility class contains functionalities common to both client and server and hence should be present in both packages.
  4. First, run the server package. The server should always be running and expecting requests from client.
  5. Next, run the client package. You will then get an option to request the contents of any of the 3 files created in step 1. Select a file and verify the output.

Testing the Client class using JUnit

Install the JUnit4, Mockito and powermock JARs. Add these jars to the project buildpath.

  1. Create a new test folder in the project and add it to the build path.
  2. Add the ClientTest.java JUnit test file to this folder.
  3. Run the file as JUnit test. (No inputs required from user as the required information is already provided in the test class)

Testing the ClientServerUtility class using JUnit

Only JUnit JARs required.

  1. Add the ClientServerUtilityTest.java JUnit test file to test folder created above.
  2. Run the file as JUnit test. (No inputs required from user as the required information is already provided in the test class)

client-server--java-udp-sockets's People

Contributors

arjunagi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

client-server--java-udp-sockets's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.