Interface Client

All Superinterfaces:
AutoCloseable, Closeable, Runnable

public interface Client extends Runnable, Closeable
A client of a ServerRunner.

This interface exists primarily to abstract away the details of the client's underlying Socket and the concurrency associated with handling multiple clients. Such realities make it difficult to create effective unit tests for the ServerRunner that are easy to understand and maintain.

This interface captures the only those details about a client that the ServerRunner cares about; namely, that it is something that

  1. is Runnable — i.e. it can be executed concurrently
  2. holds resources that need to be closed before the client is discarded
Author:
Carl Harris