Coder Social home page Coder Social logo

networking_in_java's Introduction

Networking_In_Java

Networking means communication between two or more devices connected in a network. Networking allows sharing of files, data among a group of users. Java allows user to develop a complete system to communicate between certain users.

Pre-Requistes

  • Difference between LAN-MAN-WAN.
  • What is WWW(World Wide Web)?
  • IP Address Concept
  • Port Number
  • MAC address
  • What is a Socket ?
  • Networking Protocols
  • TCP-IP
  • UDP

Java Networking

For networking in Java firstly we should know that how many sockets java allows us to use ? Java allows us to use two sockets:

  • Stream Sockets

Stream Sockets use TCP protocol to create a communication between two systems. Here data flows in the form of Continous Streams while the connection is in place.

  • Datagram Sockets

Datagram Sockets use UDP protocol in which the packets of information are shared between two systems. It is Connection-less service protocol.

Classes In Java

  • Different classes through which the connection related information can be accessed are :-
  • Different classes through which the communication could be done between two systems are :-
  • These all classes are included in java.net.* package.

Communication Using UDP

One-Way Communication

  • First Run the Server.java program so that server gets ready to recieve the messages then run the Client.java program.

  • img0

  • img1

Two-Way Communication

  • First Run the Server.java program so that server gets ready to recieve the messages then run the Client.java program.

  • img0

  • img1

Communication Using TCP

One-Way Communication

  • First Run the Server.java program so that server gets ready to recieve the messages then run the Client.java program.

  • img0

  • img1

Two-Way Communication

  • First Run the Server.java program so that server gets ready to recieve the messages then run the Client.java program.

  • img0

  • img1

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.