/* File name: OfflineServer.java                     */
/*                                                   */
/* Author: Robert Uomini                             */
/*****************************************************/
import java.util.*;
import java.io.*;
import java.net.*;

class NNTPServer
  {
  public OfflineServer()
    {
    ServerSocket  nntp_socket = null;

    Socket inbound = null;

    Thread  nntp_thread;

/*****************************************************/
/*  Open a new socket connection on the NNTP port to */
/*  accept commands from WebReader, and listen until */
/*  the connection is broken by the client. The      */
/*  ServerThread() class handles client requests.    */ 
/*****************************************************/
    try
      {
      nntp_socket = new ServerSocket(119);
      while(true)
        {
        inbound = nntp_socket.accept();
        nntp_thread = new ServerThread(inbound);
        nntp_thread.start();
        }
      }
    catch (IOException e)
      {
      System.out.println(
        "Error connecting to socket: " + e);
      System.exit(0);
      }
    }

  public static void main(String args[])
    {
    new OfflineServer();
    } 
  }


