Setup

  • creation of empty project
  • initial maven configuration
  • gitignore

Commit

UDP Server

  • UDP server creation

  • Error handling:

    • local recovery (retry listening)
    • notify caller (failure to bind port in server)
    • tear down application on fatal error (failure to start UDP server)

Commit

UDP Sender

  • methods for sending UDP messages
  • usage of static methods (when no context/state is needed from a class)

Commit

Data classes: UDPMessage

  • data classes:
    • record syntax
    • overriding equals, hashCode, toString

Commit

UDPServer: Observer Pattern

  • implement an Observer design pattern
  • make library code generic and customizable

Commit

UDPServer: Thread safety

  • prevent potential data races when accessing class data.

Commit

Test

  • setting up tests with junit
  • exploitation of the observer to gather the results of the test code

Commit

Note: When modifying pom.xml, you may need to update the project configuration (IntelliJ IDEA: right click on pom.xml > Maven > Reload Project)

Continuous Integration

  • setting up the continuous integration to run compilation and tests with Github actions

Commit

Logging

  • import the log4j library
  • add logging messages at different levels
  • configure the logger
    • with configuration file (default configuration)
    • manually override log level to select the appropriate level for the use case (tests vs user-facing programs)

Commit

Note: the listening port can be found with socket.getLocalPort() (fixed in the git)