Skip to content
Network-Programming-aka-UniwaPublic

About

Java client-server application demonstrating socket communication, file transfer, and request handling for a network programming laboratory assignment (Network Programming, UNIWA).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

UNIWA

UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS

University of West Attica · Department of Computer Engineering and Informatics


Network Programming

Sockets

Vasileios Evangelos Athanasiou
Student ID: 19390005

GitHub · LinkedIn


Supervision

Supervisor: Nikolaos Zacharis, Professor

UNIWA Profile

Co-supervisor: Georgios Meletiou, Laboratory Teaching Staff

UNIWA Profile


Athens, February 2024



README

Sockets

This project demonstrates a simple Client-Server application in Java, where the server sends a list of files to the client, processes a request to open a specific file, and handles communication over sockets.


Table of Contents

Section Folder/File Description
1 assign/ Assignment material for the Sockets workshop
1.1 assign/Laboratory-Assessment-Assignment.pdf Assignment description in English
1.2 assign/Εργασία-Αξιολόγησης-Εργαστηρίου.pdf Assignment description in Greek
2 src/ Source code files for socket programming examples
2.1 src/Client.java Java client implementation for socket communication
2.2 src/Server.java Java server implementation for socket communication
3 README.md Repository overview
4 INSTALL.md Usage instructions

1. Overview

The application consists of two main components:

  • Server:
    Listens for client connections, sends a list of files, and responds to client requests.

  • Client:
    Connects to the server, receives the list of files, requests a specific file, and interacts with the server.


2. Features

  1. Client-Server Communication

    • Server listens on port 8080 and accepts incoming connections.
    • Client sends requests for specific files and receives the server’s response.
  2. File List Transfer

    • Server sends a list of 10 file names: 0.txt, 1.txt, ..., 9.txt.
  3. File Request Handling

    • Client requests "1.txt" and server returns the content.
    • If any other file is requested, server responds with "File not found".
  4. Continue or Disconnect

    • After processing a request, the server asks the client whether to continue ("y") or disconnect ("n").
    • On "n", the server sends a goodbye message and closes the connection.

3. Code Structure

  • Server.java:
    Implements the server, listening on port 8080, sending file names, and responding to file requests.

  • Client.java:
    Implements the client, connects to the server, receives the file list, requests a file, and handles server responses.


4. Conclusion

This project provides a practical example of socket-based communication in Java, demonstrating file transfer, request handling, and interactive client-server protocols in a simple, extensible application.

About

Java client-server application demonstrating socket communication, file transfer, and request handling for a network programming laboratory assignment (Network Programming, UNIWA).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages