package org.distributed;
/**
 * Main.java
 * by Tinsae Ghilay
 * Entry point for the chat application.
 * done for Distributed Systems Course - Week 2 Task 2
 * Date: June 2024
 */

import java.util.Scanner;
public class Main {

    // entry point
    public static void main(String[] args) throws Exception {

        // create a client
        ChatHandler handler = new ChatHandler();

        // init connection and session session
        handler.initializeSession();

        // create scanner for user input
        Scanner sc = new Scanner(System.in);

        // log in user
        handler.promptForUser(sc);

        // specify correspondent
        handler.promptForCorespondent(sc);

        // start conversation
        handler.startConversation(sc);

        // close session after all receivers are processed
        handler.closeSession();
    }
}
