Index: nanovis/branches/1.2/Command.cpp
===================================================================
--- nanovis/branches/1.2/Command.cpp	(revision 6619)
+++ nanovis/branches/1.2/Command.cpp	(revision 6620)
@@ -37,7 +37,5 @@
 #include <unistd.h>                     /* Needed for getpid, gethostname,
                                          * write, etc. */
-#if !defined(USE_NEW_EVENT_LOOP) && !defined(USE_THREADS)
-#include <fcntl.h>
-#endif
+
 #include <sstream>
 
@@ -538,34 +536,8 @@
 nv::GetDataStream(Tcl_Interp *interp, Rappture::Buffer &buf, int nBytes)
 {
-#if defined(USE_NEW_EVENT_LOOP) || defined(USE_THREADS)
     if (!SocketRead((char *)buf.bytes(), nBytes)) {
         return TCL_ERROR;
     }
     buf.count(nBytes);
-#else
-    char buffer[8096];
-
-    clearerr(g_fIn);
-    while (nBytes > 0) {
-        unsigned int chunk;
-        int nRead;
-
-        chunk = (sizeof(buffer) < (unsigned int) nBytes) ?
-            sizeof(buffer) : nBytes;
-        nRead = fread(buffer, sizeof(char), chunk, g_fIn);
-        if (ferror(g_fIn)) {
-            Tcl_AppendResult(interp, "while reading data stream: ",
-                             Tcl_PosixError(interp), (char*)NULL);
-            return TCL_ERROR;
-        }
-        if (feof(g_fIn)) {
-            Tcl_AppendResult(interp, "premature EOF while reading data stream",
-                             (char*)NULL);
-            return TCL_ERROR;
-        }
-        buf.append(buffer, nRead);
-        nBytes -= nRead;
-    }
-#endif
     Rappture::Outcome err;
     TRACE("Checking header [%.13s]", buf.bytes());
@@ -2251,79 +2223,4 @@
 }
 
-#if !defined(USE_NEW_EVENT_LOOP) && !defined(USE_THREADS)
-int
-nv::processCommands(Tcl_Interp *interp, FILE *inFile, int fdOut)
-{
-    int ret = 0;
-    int status = TCL_OK;
-
-    Tcl_DString cmdbuffer;
-    Tcl_DStringInit(&cmdbuffer);
-
-    int flags = fcntl(0, F_GETFL, 0);
-    fcntl(0, F_SETFL, flags & ~O_NONBLOCK);
-
-    //  Read and execute as many commands as we can from stdin...
-    bool isComplete = false;
-    while ((!feof(inFile)) && (status == TCL_OK)) {
-        //
-        //  Read the next command from the buffer.  First time through we
-        //  block here and wait if necessary until a command comes in.
-        //
-        //  BE CAREFUL: Read only one command, up to a newline.  The "volume
-        //  data follows" command needs to be able to read the data
-        //  immediately following the command, and we shouldn't consume it
-        //  here.
-        //
-        while (!feof(inFile)) {
-            int c = fgetc(inFile);
-            char ch;
-            if (c <= 0) {
-                if (errno == EWOULDBLOCK) {
-                    break;
-                }
-                return -1;
-            }
-            ch = (char)c;
-            Tcl_DStringAppend(&cmdbuffer, &ch, 1);
-            if (ch == '\n') {
-                isComplete = Tcl_CommandComplete(Tcl_DStringValue(&cmdbuffer));
-                if (isComplete) {
-                    break;
-                }
-            }
-        }
-        // no command? then we're done for now
-        if (Tcl_DStringLength(&cmdbuffer) == 0) {
-            break;
-        }
-        if (isComplete) {
-            // back to original flags during command evaluation...
-            fcntl(0, F_SETFL, flags & ~O_NONBLOCK);
-            struct timeval start, finish;
-            gettimeofday(&start, NULL);
-            status = ExecuteCommand(interp, &cmdbuffer);
-            gettimeofday(&finish, NULL);
-            // non-blocking for next read -- we might not get anything
-            fcntl(0, F_SETFL, flags | O_NONBLOCK);
-            isComplete = false;
-            g_stats.cmdTime += (MSECS_ELAPSED(start, finish) / 1.0e+3);
-            g_stats.nCommands++;
-        }
-    }
-    fcntl(0, F_SETFL, flags);
-
-    if (status != TCL_OK) {
-        if (handleError(interp, status, fdOut) < 0) {
-            return -1;
-        }
-        TRACE("Leaving on ERROR");
-    }
-
-    return ret;
-}
-
-#endif
-
 /**
  * \brief Execute commands from client in Tcl interpreter
Index: nanovis/branches/1.2/Command.h
===================================================================
--- nanovis/branches/1.2/Command.h	(revision 6619)
+++ nanovis/branches/1.2/Command.h	(revision 6620)
@@ -38,9 +38,4 @@
 extern bool SocketRead(char *bytes, size_t len);
 
-#if !defined(USE_NEW_EVENT_LOOP) && !defined(USE_THREADS)
-extern int processCommands(Tcl_Interp *interp,
-                           FILE *inBufPtr,
-                           int fdOut);
-#endif
 extern int processCommands(Tcl_Interp *interp,
                            ReadBuffer *inBufPtr,
Index: nanovis/branches/1.2/config.h
===================================================================
--- nanovis/branches/1.2/config.h	(revision 6619)
+++ nanovis/branches/1.2/config.h	(revision 6620)
@@ -49,6 +49,4 @@
 #define KEEPSTATS
 
-//#define USE_NEW_EVENT_LOOP
-
 /*
  * Controls whether DX data is downsampled.
Index: nanovis/branches/1.2/nanovisServer.cpp
===================================================================
--- nanovis/branches/1.2/nanovisServer.cpp	(revision 6619)
+++ nanovis/branches/1.2/nanovisServer.cpp	(revision 6620)
@@ -50,5 +50,4 @@
 int nv::g_fdIn = STDIN_FILENO;     ///< Input file descriptor
 int nv::g_fdOut = STDOUT_FILENO;   ///< Output file descriptor
-FILE *nv::g_fIn = NULL;            ///< Input file handle
 FILE *nv::g_fOut = NULL;           ///< Output file handle
 FILE *nv::g_fLog = NULL;           ///< Trace logging file handle
@@ -315,5 +314,4 @@
 initService()
 {
-    g_fIn = fdopen(g_fdIn, "r");
     // Create a stream associated with the output file descriptor
     g_fOut = fdopen(g_fdOut, "w");
@@ -385,5 +383,4 @@
     glutSetWindow(NanoVis::renderWindow);
 
-#if defined(USE_NEW_EVENT_LOOP) || defined(USE_THREADS)
     struct timeval timeout;
     timeout.tv_sec = g_idleTimeout;
@@ -392,9 +389,4 @@
         exitService(1);
     }
-#else
-    if (processCommands(NanoVis::interp, g_fIn, g_fdOut) < 0) {
-        exitService(1);
-    }
-#endif
 
     NanoVis::update();
@@ -417,13 +409,7 @@
     }
 
-#if defined(USE_NEW_EVENT_LOOP) || defined(USE_THREADS)
     if (g_inBufPtr->status() == ReadBuffer::ENDFILE) {
         exitService(0);
     }
-#else
-    if (feof(g_fIn)) {
-        exitService(0);
-    }
-#endif
 
     TRACE("Leave");
@@ -547,7 +533,5 @@
     fflush(g_fOut);
 
-#if defined(USE_NEW_EVENT_LOOP) || defined(USE_THREADS)
     g_inBufPtr = new ReadBuffer(g_fdIn, 1<<12);
-#endif
 
     Tcl_Interp *interp = Tcl_CreateInterp();
Index: nanovis/branches/1.2/nanovisServer.h
===================================================================
--- nanovis/branches/1.2/nanovisServer.h	(revision 6619)
+++ nanovis/branches/1.2/nanovisServer.h	(revision 6620)
@@ -43,5 +43,4 @@
     extern int g_fdIn;             ///< Input file descriptor
     extern int g_fdOut;            ///< Output file descriptor
-    extern FILE *g_fIn;            ///< Input file handle
     extern FILE *g_fOut;           ///< Output file handle
     extern FILE *g_fLog;           ///< Trace logging file handle
