public static void main(String[] args) throws Exception
{
DatagramSocket socket = new DatagramSocket(2310,InetAddress.getLocalHost());
InetAddress clientAddress; //socket created here
int port;
Main.flightdetails = new FlightInfo("flightinfo.txt"); //textfile is retrived here into class FlightInfo
Main m = new Main(); //object for main class created
// TODO code application logic
for(int i=0;i<2;i++) //main server loop
{
System.out.println("Server Started");
byte[] buffer = new byte[256];
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
socket.receive(packet); //recive packet containing client username
String clientName = new String(buffer);
clientAddress = packet.getAddress();
port = packet.getPort();
System.out.print(clientName);
Main.FlightServer f = m.new FlightServer(clientAddress, port,clientName);
Thread t = new Thread(f); //thread created here for any concurrent clients
t.start();
} //end of for loop
}/