
package uk.co.wingpath.io;

import java.io.*;

/**
* Interface for providing a service on a connection.
*/

public interface Service
{
    /**
    * Provides a service on the supplied connection.
    * <p>Implementations of this method will normally use a loop to
    * receive requests from the connection and send responses to the
    * connection.
    * @param connection the connection on which the service is to be
    * provided.
    * @throws EOFException if the connection is closed.
    * @throws IOException if an I/O error occurs.
    * @throws InterruptedException if the thread is interrupted.
    */
    void serve (Connection connection)
        throws IOException, InterruptedException;
}

