Server.java 538 Bytes
Newer Older
Michele Fiori's avatar
Michele Fiori committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package theatre;

import theatre.ServerThread;

import java.io.*;
import java.net.*;

class Server {
    public static void main(String[] argv) throws Exception {
        Reservations reservations = new Reservations();

        ServerSocket welcomeSocket = new ServerSocket(9876);

        while(true) {
            Socket connectionSocket = welcomeSocket.accept();
            theatre.ServerThread theThread = new theatre.ServerThread(connectionSocket, reservations);
            theThread.start();
        }
    }
}