package Communication.Messages.Service;
import Common.GenericThread;
import java.io.*;
import java.net.InetSocketAddress;
public abstract class ReceivingThread extends GenericThread
{
public abstract void receive() throws InterruptedException, IOException;
protected abstract MessageSession getMessageSession(InetSocketAddress address);
@Override
public final void run()
{
while (!this.shouldStop())
{
try
{
this.receive();
}
catch (InterruptedException e)
{
return;
} catch (IOException e) {
e.printStackTrace();
}
}
}
}