Code Monkey home page Code Monkey logo

simple-java-client-server's Introduction

AUTHORS: Ikonija Bogojevic, Miguel Perez, Sandra Weber

DESCRIPTION

This is a simple client and server written in Java using the socket API. Both the client and server are multithreaded. The client can use multiple threads to simulate multiple simultanous connections to the server, which will create a new thread for every incoming connection.  



Client
--------

COMPILATION
$ javac Client.java

USAGE
$ java Client hostname

where hostname is the name of the machine the server is running on. If it is the same machine as the client, use localhost. 

The client program offers the user a choice of UNIX commands to run on the server. After the user chooses a command, the client creates a thread which connects to the server and sends it the user's choice. The client will print the answer that it receives from the server (unless the client is in benchmark mode).

The client program can also open multiple simultaneous connections to the server. To do this, choose option 7, Benchmark, from the main menu. It will then prompt for which command to benchmark and how many connections to open. It will calculate and display an average response time for all connections.



Server
--------

COMPILATION
$ javac Server.java

USAGE
$ java Server

This will make the server listen on port 15432 for incoming connections from client(s). The server listens for incoming connections in its main loop, and creates a new thread to handle every incoming connection. These threads run UNIX commands on the server machine and send their output to the client(s).

simple-java-client-server's People

Watchers

 avatar

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.