Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.27 KB

File metadata and controls

50 lines (35 loc) · 1.27 KB

Java Socket Programming

This repository is a collection of Java examples and exercises to demonstrate the basics and practical use of socket programming in Java. It includes code samples and explanations for creating both client-server and peer-to-peer network applications using Java's networking libraries.

Features

  • Examples for both TCP and UDP socket communication
  • Simple chat application using sockets
  • File transfer between client and server
  • Handling multiple clients with multithreading
  • Clear, well-documented sample code for learning and experimenting

Getting Started

  1. Clone this repository:

    git clone https://github.com/j-ordanos/Java-socket-programming.git
    cd Java-socket-programming
  2. Compile the Java files:

    javac src/*.java
  3. Run the example programs:

    java src.Server
    java src.Client

    (Replace Server and Client with the actual class names as needed.)

Requirements

  • Java JDK 8 or higher

Examples

  • Echo server and client
  • Multi-client chat server
  • File transfer with sockets
  • UDP datagram exchange

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

MIT