GithubHelp home page GithubHelp logo

davis-ty / client_server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6 KB

Java client-server app using sockets: Client sends input to server, receives modified responses. Server handles multiple clients concurrently. Demonstrates networking and multithreading in Java.

Java 100.00%

client_server's Introduction

Client_Server

  • This Java program consists of a client-server application using sockets for communication.

Client (client.java):

  • The client establishes a connection with the server using the localhost address and port 4999.
  • It reads user input from the console and sends it to the server.
  • The client continues sending input until the user types "END".
  • The client also listens for responses from the server and prints them to the console.

Server (server.java):

  • The server listens on port 4999 for incoming client connections.
  • Upon accepting a connection, it creates a new thread (MultiClientHandler) to handle client requests concurrently.
  • The MultiClientHandler thread receives messages from the client, converts them to uppercase, reverses the words and letters, and sends the modified message back to the client.
  • The server continues listening for and processing client requests indefinitely.

MultiClientHandler (MultiClientHandler.java):

  • This class represents a thread responsible for handling communication with a single client.
  • It receives messages from the client, processes them (converts to uppercase, reverses words and letters), and sends the modified message back to the client.
  • Upon receiving the "END" message from the client, it closes the connection and terminates the thread.
  • This application demonstrates the use of sockets for establishing communication between a client and server, as well as multithreading to handle multiple client connections simultaneously. It showcases basic networking concepts and concurrent programming techniques in Java.

client_server's People

Contributors

davis-ty avatar

Stargazers

 avatar

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.