package com.jscape.inet.ssh.protocol.transport;

import com.jscape.inet.ssh.protocol.messages.IdentificationString;
import com.jscape.inet.ssh.protocol.messages.Message;
import com.jscape.util.net.connection.MessageCodecConnection;

/**
 * @author Alex Usun
 */
public interface TransportServer {

    void start(Listener listener,
               MessageCodecConnection<Message> connection,
               IdentificationString clientIdentificationString,
               IdentificationString serverIdentificationString);

    void onMessage(Message message);

    void close();

    interface Listener {

        void onClosed(TransportServer server, MessageCodecConnection<Message> connection);

    }
}
