Skip to content

Soufiane-Chajjaoui/JavaSocketCourse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Sockets in Java

In Java, sockets provide a mechanism for communication between two applications over a network. Java's java.net package includes classes that facilitate the creation, connection, and communication through sockets.

Socket Basics

Java supports both TCP and UDP sockets. Here's a brief overview:

TCP Sockets

  • ServerSocket Class:

    • Represents a server-side socket that listens for incoming connections.
    • Created using ServerSocket class.
  • Socket Class:

    • Represents a client-side socket that connects to a server.
    • Created using the Socket class.

UDP Sockets

  • DatagramSocket Class:
    • Used for connectionless communication.
    • Datagram packets can be sent and received using DatagramSocket class.

Practice Exercises

For practical exercises related to Java sockets, check out the Exercises branch.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published