Sockets hang using PrintWriter and BufferedReader

Solaris 2.7, and Java 1.2.2
My thread is passed a new socket = s. I then assign:
InputStreamReader isr = new InputStreamReader(s.getInputStream());
BufferedReader br = new BufferedReader(isr);
PrintWriter pw = new PrintWriter(s.getOutputStream());
The client program then sends records. If each record has only a "\r" then
the program fails. If the client sends a "\n" or "\r\n" then the program
works fine.
The documentation for BufferedReader states that it looks for a "\r" or a
"\n" or a "\r\n".
I don't get any indication that there is a problem other than the hang.
Upon Connect...
Server> send("0000\n")
client> recv("0000\n")
client> send("0001\r")
Server> recv("0001")
Server> send("0002\n")
client> recv -- nothing...
Server> recv paused...
I have run truss on this process and it shows that nothing is sent on the last server send above. When the client gives up (e.g. timeout) the the send completes as truss sees it.
Is this a bug in 1.2.2. or a documentation error?

use flush()!!

Similar Messages

  • Why using BefferedReder and PrintWriter if we have Input/OutputStream

    hi
    i've been wondering if we have an InputStream and OutputStream why using PrintWriter and BufferedReader
                    in=s.getInputStream();
                    out=s.getOutputStream();
                    bfr=new BufferedReader(new InputStreamReader(in));
                    writer=new PrintWriter(out,true);where s ia a socket
    Edited by: scrolldown on Mar 29, 2008 3:03 AM
    Edited by: scrolldown on Mar 29, 2008 3:04 AM

    Everything that is a InputStream/OutputStream is used to handle raw byte streams.
    Everything that is a Reader/Writer is used to handle character data.
    In your case the InputStreamReader provides the conversion from raw bytes to character data. Usually it does so using some specified encoding, in your case it uses your platform default encoding.
    The PrintWriter does the same for the output, but doesn't allow you to specify an encoding (for this you'd have to use an OutputStreamWriter).
    And please note, that it's usually an error to do any byte -> character or character -> byte conversion without specifying a character set, especially when handling sockets, because then the platform default encoding will be used which can be different from computer to computer and thus you don't know what exactly is sent over the wire.
    If you don't know what I'm talking about, then read [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)|http://www.joelonsoftware.com/articles/Unicode.html], an excellent article that gives a good overview over the matter.

  • Difference between printwriter and servletoutputstream

    we can use printwriter and servletoutputstream to send the response to client ,but what is the difference between them

    we can use printwriter and servletoutputstream to send the
    response to client ,but what is the difference between themDid you read documentation ?
    It says: To send binary data in a MIME body response, use the ServletOutputStream returned by getOutputStream(). To send character data, use the PrintWriter object returned by getWriter().

  • Possible to use both a PrintWriter and BufferedOutputStream?

    I have made a PrintWriter and BufferedOutputStream on the same socket that my client uses to connect to the server. I start by sending some string with the PrintWriter followed by some bytes with the BufferedOutputStream.
    I does not work, so I would like to know if its not possible to connect these to out channels to the same socket.

    On the Client side (the PrintWriter's second argument is true so it should autoflush):
    out = new PrintWriter(socket.getOutputStream(),true);
                        String s = "sally";
                        byte[]sb = s.getBytes();
                        int len1 = sb.length;
                        out.println(len1 + "");
                       outBytes = new BufferedOutputStream(socket.getOutputStream());
                       outBytes.write(sb, 0, len1);
                       outBytes.flush();on the serverside:
                  in = new BufferedReader(
                            new InputStreamReader(
                            socket.getInputStream()));
    inBytes = new BufferedInputStream(socket.getInputStream());
                       int len1 = Integer.valueOf(in.readLine()).intValue();           
                        byte[] clientPub = new byte[len1];    
                        System.out.println("test");
                       inBytes.read(clientPub, 0, len1);
                            System.out.println("test22");test22 never gets printed so it must be inBytes.read(clientPub, 0, len1); that is blocking. But the out on the client should autoflush and I have also tried out.flush() but it does not help.

  • Problem in using socket streams with encryption and decryption

    Hi,
    I am developing a client/server program with encryption and decryption at both end. While sending a message from client it should be encrypted and at the receiving end(server) it should be decrypted and vice versa.
    But while doing so i got a problem if i use both encryption and decryption at both ends. But If i use only encryption at one (only outputstream) and decryption at other end(only inputstream) there is no problem.
    Here is client/server pair of programs in which i am encrypting the outputstream of the socket in client side and decrypting the inputstream of the socket in server side.
    serverSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class serverSocketDemo
         public static void main(String args[])
              try
              {                    //server listening on port 2000
                   ServerSocket server=new ServerSocket(2000);
                   while (true)
                        Socket theConnection=server.accept();
                        System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                        System.out.println("Connection request from : "+theConnection.getInetAddress());
                        //Input starts from here
                        Reader in=new InputStreamReader(getNetInStream(theConnection.getInputStream()),"ASCII");
                        StringBuffer strbuf=new StringBuffer();
                        int c;
                        while (true)
                             c=in.read();
                             if(c=='\n' || c==-1)
                                  break;
                             strbuf.append((char)c);     
                        String str=strbuf.toString();
                        System.out.println("Message from Client : "+str);
                        in.close();               
                        theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static BufferedInputStream getNetInStream(InputStream in) throws Exception
              // register the provider that implements the algorithm
              Provider sunJce = new com.sun.crypto.provider.SunJCE( );
              Security.addProvider(sunJce);
              // create a key
              byte[] desKeyDataDec = "This encryption can not be decrypted".getBytes();
              DESKeySpec desKeySpecDec = new DESKeySpec(desKeyDataDec);
              SecretKeyFactory keyFactoryDec = SecretKeyFactory.getInstance("DES");
              SecretKey desKeyDec = keyFactoryDec.generateSecret(desKeySpecDec);
              // use Data Encryption Standard
              Cipher desDec = Cipher.getInstance("DES");
              desDec.init(Cipher.DECRYPT_MODE, desKeyDec);
              CipherInputStream cin = new CipherInputStream(in, desDec);
              BufferedInputStream bin=new BufferedInputStream(new GZIPInputStream(cin));
              return bin;
    clientSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class clientSocketDemo
         public static void main(String args[])
              try
                   Socket theConnection=new Socket("localhost",2000);
                   System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                   System.out.println("Connecting to : "+theConnection.getInetAddress());
                   //Output starts from here               
                   OutputStream out=getNetOutStream(theConnection.getOutputStream());
                   out.write("Please Welcome me\n".getBytes());
                   out.flush();
                   out.close();
                   theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static OutputStream getNetOutStream(OutputStream out) throws Exception
              // register the provider that implements the algorithm
              Provider sunJce = new com.sun.crypto.provider.SunJCE( );
              Security.addProvider(sunJce);
              // create a key
              byte[] desKeyDataEnc = "This encryption can not be decrypted".getBytes();
              DESKeySpec desKeySpecEnc = new DESKeySpec(desKeyDataEnc);
              SecretKeyFactory keyFactoryEnc = SecretKeyFactory.getInstance("DES");
              SecretKey desKeyEnc = keyFactoryEnc.generateSecret(desKeySpecEnc);
              // use Data Encryption Standard
              Cipher desEnc = Cipher.getInstance("DES");
              desEnc.init(Cipher.ENCRYPT_MODE, desKeyEnc);
              CipherOutputStream cout = new CipherOutputStream(out, desEnc);
              OutputStream outstream=new BufferedOutputStream(new GZIPOutputStream(cout));
              return outstream;
    Here is client/server pair in which i use both encrypting outpustream and decrypting inputstream at both ends.
    serverSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class serverSocketDemo
         private Cipher desEnc,desDec;
         serverSocketDemo()
              try
                   // register the provider that implements the algorithm
                   Provider sunJce = new com.sun.crypto.provider.SunJCE( );
                   Security.addProvider(sunJce);
                   // create a key
                   byte[] desKeyData = "This encryption can not be decrypted".getBytes();
                   DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
                   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
                   SecretKey desKey = keyFactory.generateSecret(desKeySpec);
                   desEnc = Cipher.getInstance("DES");
                   desEnc.init(Cipher.ENCRYPT_MODE, desKey);
                   desDec = Cipher.getInstance("DES");
                   desDec.init(Cipher.DECRYPT_MODE, desKey);               
              catch (javax.crypto.NoSuchPaddingException e)
                   System.out.println(e);          
              catch (java.security.NoSuchAlgorithmException e)
                   System.out.println(e);          
              catch (java.security.InvalidKeyException e)
                   System.out.println(e);          
              catch(Exception e)
                   System.out.println(e);
              startProcess();
         public void startProcess()
              try
                   ServerSocket server=new ServerSocket(2000);
                   while (true)
                        final Socket theConnection=server.accept();
                        System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                        System.out.println("Connection request from : "+theConnection.getInetAddress());
                        Thread input=new Thread()
                             public void run()
                                  try
                                       //Input starts from here
                                       Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");
                                       StringBuffer strbuf=new StringBuffer();
                                       int c;
                                       while (true)
                                            c=in.read();
                                            if(c=='\n'|| c==-1)
                                                 break;
                                            strbuf.append((char)c);     
                                       String str=strbuf.toString();
                                       System.out.println("Message from Client : "+str);
                                  catch(Exception e)
                                       System.out.println("Error caught inside input Thread : "+e);
                        input.start();
                        Thread output=new Thread()
                             public void run()
                                  try
                                       //Output starts from here
                                       OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
                                       System.out.println("it will not be printed");
                                       out.write("You are Welcome\n".getBytes());
                                       out.flush();
                                  catch(Exception e)
                                       System.out.println("Error caught inside output Thread : "+e);
                        output.start();
                        try
                             output.join();
                             input.join();
                        catch(Exception e)
                        theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static void main(String args[])
              serverSocketDemo server=new serverSocketDemo();          
    clientSocketDemo.java
    import java.io.*;
    import java.net.*;
    import java.security.*;
    import java.security.spec.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.util.*;
    import java.util.zip.*;
    class clientSocketDemo
         private Cipher desEnc,desDec;
         clientSocketDemo()
              try
                   // register the provider that implements the algorithm
                   Provider sunJce = new com.sun.crypto.provider.SunJCE( );
                   Security.addProvider(sunJce);
                   // create a key
                   byte[] desKeyData = "This encryption can not be decrypted".getBytes();
                   DESKeySpec desKeySpec = new DESKeySpec(desKeyData);
                   SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
                   SecretKey desKey = keyFactory.generateSecret(desKeySpec);
                   desEnc = Cipher.getInstance("DES");
                   desDec = Cipher.getInstance("DES");
                   desEnc.init(Cipher.ENCRYPT_MODE, desKey);
                   desDec.init(Cipher.DECRYPT_MODE, desKey);               
              catch (javax.crypto.NoSuchPaddingException e)
                   System.out.println(e);          
              catch (java.security.NoSuchAlgorithmException e)
                   System.out.println(e);          
              catch (java.security.InvalidKeyException e)
                   System.out.println(e);          
              catch(Exception e)
                   System.out.println(e);
              startProcess();
         public void startProcess()
              try
                   final Socket theConnection=new Socket("localhost",2000);
                   System.out.println("Connecting from local address : "+theConnection.getLocalAddress());
                   System.out.println("Connecting to : "+theConnection.getInetAddress());
                   Thread output=new Thread()
                        public void run()
                             try
                                  //Output starts from here               
                                  OutputStream out=new BufferedOutputStream(new CipherOutputStream(theConnection.getOutputStream(), desEnc));
                                  out.write("Please Welcome me\n".getBytes());
                                  out.flush();
                             catch(Exception e)
                                  System.out.println("Error caught inside output thread : "+e);
                   output.start();     
                   Thread input=new Thread()
                        public void run()
                             try
                                  //Input starts from here
                                  Reader in=new InputStreamReader(new BufferedInputStream(new CipherInputStream(theConnection.getInputStream(), desDec)),"ASCII");          
                                  System.out.println("it will not be printed");
                                  StringBuffer strbuf=new StringBuffer();
                                  int c;
                                  while (true)
                                       c=in.read();
                                       if(c=='\n' || c==-1)
                                            break;
                                       strbuf.append((char)c);     
                                  String str=strbuf.toString();
                                  System.out.println("Message from Server : "+str);
                             catch(Exception e)
                                  System.out.println("Error caught inside input Thread : "+e);
                   input.start();
                   try
                        output.join();
                        input.join();
                   catch(Exception e)
                   theConnection.close();
              catch(BindException e)
                   System.out.println("The Port is in use or u have no privilage on this port");
              catch(ConnectException e)
                   System.out.println("Connection is refused at remote host because the host is busy or no process is listening on that port");
              catch(IOException e)
                   System.out.println("Connection disconnected");          
              catch(Exception e)
         public static void main(String args[])
              clientSocketDemo client=new clientSocketDemo();     
    **** I know that the CInput tries to read some header stuff thats why i used two threads for input and output.
    Waiting for the reply.
    Thank you.

    Do not ever post your code unless requested to. It is very annoying.
    Try testing what key is being used. Just to test this out, build a copy of your program and loop the input and outputs together. Have them print the data stream onto the screen or a text file. Compare the 1st Output and the 2nd Output and the 1st Input with the 2nd Input and then do a static test of the chipher with sample data (same data which was outputted), then do another cipher test with the ciphertext created by the first test.
    Everything should match - if it does not then follow the steps below.
    Case 1: IO Loops do not match
    Case 2: IO Loops match, but ciphertext 1st run does not match loop
    Case 3: IO Loops match, 1st ciphertext 1st run matches, but 2nd run does not
    Case 4: IO Loops match, both chiphertext runs do not match anything
    Case 5: Ciphertext runs do not match eachother when decrypted correctly (outside of the test program)
    Problems associated with the cases above:
    Case 1: Private Key is changing on either side (likely the sender - output channel)
    Case 2: Public Key is changing on either side (likely the sender - output channel)
    Case 3: Private Key changed on receiver - input channel
    Case 4: PKI failure, causing private key and public key mismatch only after a good combination was used
    Case 5: Same as Case 4

  • Acrobat X Pro hangs when making PDF. Using on Windows 7 64. Just started hanging. Uninstalled and reinstalled. Installed update. Once it hangs, must go into crtl, alt, delete to force close.

    Acrobat X Pro hangs when making PDF. Using on Windows 7 64. Just started hanging. Uninstalled and reinstalled. Installed update. Once it hangs, must go into crtl, alt, delete to force close.

    As a debugging step, try printing to the Adobe PDF printer. If that fails, repeat with print-to-file selected. Assuming the print succeeds, open the file in Distiller to complete the creation of the PDF. If you get the PDF, then check to see if AcroTray is properly working as a background task.

  • TS3742 I have an iMac 24" system. I just recently installed MAC OS X 10.7.4 (Lion) on my system. Since doing so, my system consistently hangs. Particularly when using iMovie and iPhoto.

    I have an iMac 24" system. I just recently installed MAC OS X 10.7.4 (Lion) on my system. Since doing so, my system consistently hangs. Particularly when using iMovie and iPhoto. I have to power off my system to get it running again. Any suggestions on what I can do  to address this situation.

    I would first reset the SMC:
    Shut down and unplug the Mac.
    Keep the Mac unplugged for at least fifteen seconds.
    Plug the Mac back in and do not turn it back on for at least five seconds.
    Press the power button to turn the Mac back on.
    Then I would reset the PRAM by rebooting the iMac while simultaneously holding the Command-Option-P-R keys until the machine restarts a second time.
    Let us know if these  procedures don't solve the problems.
    Hope this helps

  • After the update, Photoshop CC hangs after launch and can't be used. How do I fix this?

    After the update, Photoshop CC hangs after launch and can't be used. How do I fix this?

    Please try to perform the steps given the following help article.
    http://helpx.adobe.com/photoshop/kb/cc-applications-crash-immediately-launch.html
    If it does not worked then try to reset the preference of Photoshop CC application.
    Please check http://helpx.adobe.com/photoshop/kb/preference-file-functions-names-locations.html in order to reset Photoshop preferences.

  • I get hangs using plug-ins (NIK), and can't export (hangs/crashes). Anyone experiencing this?

    Updated Aperture today (3.4.3) running 10.8.2. Now I get hangs using plug-ins (NIK), and can't export (hangs/crashes). Anyone experiencing this?

    Andrew,
    In general, I've found the Nik plug-ins to be the least problematic of all that I use. Unfortunately you haven't provided enough information so that help can be focused on your problem. So here are some of the standard steps to take.
    1. Make sure you are running Nik's latest versions. There were earlier ones that didn't work properly with ML.
    2. Which plug-ings are the problem?
    3. Have you tried the repair/rebuild option on your Aperture database? Often what appears to be problems with      a 3rd party item actually stem from some sort of fault in the database.
    4. If you're really stuck do the following steps: A. Delete the Nik plug-ings. B. Repair/rebuild the database. C.      Download Nik's latest versions. D. Reinstall. E. Test.
    This is a generic problem solving approach that fixes many things. Also, you should examine if it is a particularly type of file or set of photos or something specific in the images you are working on. A corrupt image, for example, can produce really weird things on occasion.
    Hopefully some of this is useful. If not, more detail is needed.
    Robert

  • Since downloading Maverick I have a long hang time, computer crashes, can't use word and I can't access finder, why?

    Since downloading Maverick I have a long hang time, computer crashes, can't use word and I can't access finder, why? Also, iTunes is horrible. While I'm listening to my music iTunes will just stop playing the song for at least 5 minutes and I can't force quit why does it do that? This is the first time I have ever felt like my iMac is just as bad as a PC and I wonder if Steve Jobs would have let the program be relase to the public with all the problems involved. No wonder Maverick was free. IT ***** BIG TIME!

    Hello, vanvu. 
    Thank you for visiting Apple Support Communities. 
    Since you are experiencing this issue with both a wired and wireless connection only on your home network and not at other locations, this issue would related to your router.  I would first recommend power cycling the router and testing the connection again.  If the issue persists, try updating your routers settings per the article below. 
    iOS and OS X: Recommended settings for Wi-Fi routers and access points
    http://support.apple.com/kb/ht4199
    Cheers,
    Jason H. 

  • OptionalDataException when using serialize and socket timeout

    hi,
    i'm using ObjectInputStream and ObjectOutputStream to send objects through a socket.
    I sometimes get the following exception: OptionalDataException, with the exception message as null.
    does anyone know why or how can i handle it?
    i'm sure that all i'm sending is objects.

    yes i did.
    they talk about not sending object,
    or increasing the timeout to around 3 seconds.
    i'm writing a program that its consept is writing diffrent objects, and 3 sec of blocking time is a lot for me.
    i saw that there is a lot of confusion about this problem, and thought that we might put it to an end (plus i'll solve the problem in my program :-) ).
    alon

  • Server socket Hangs

    Hi,I am using the server socket in Java to listen on a port on a computer..
    I am using the windows platform
    I use ms vj++6.0
    I am facing a peculiar problem.
    about once in 10 messages received by my server socket,
    The server socket hangs .
    Hangs means it stops responding to the incoming message & so my application
    is unable to take any action.
    I used a port scanner & found that my server port is in a "close_wait"
    state.
    Can someone tell me the reason for this.
    is it a problem with my server or can the client that sends the message be
    also responsible for this type of an error.
    Heres the code for my server
    public server()
    try
    server = new ServerSocket(2156);
    serverthread = new Thread(this);
    serverthread.start();
    catch(Exception e)
    System.out.println("Cannot Start Thread" + e);
    public synchronized void run()
    try
    while(true)
    String line;
    System.out.println("listening for the client");
    fromclient = server.accept();
    System.out.println("client has responded");
    InputStreamReader isr = new
    InputStreamReader(fromclient.getInputStream());
    BufferedReader instream = new BufferedReader(isr);
    PrintWriter ostream = new PrintWriter(new
    BufferedOutputStream(fromclient.getOutputStream()));
    System.out.println("talking to the client\n");
    ostream.println("Hye Client");
    ostream.println("Bye");
    ostream.flush();
    System.out.println("listening to the client \n");
    String temp;
    int count=0;
    String ip="";
    while((line=instream.readLine())!=null)
    System.out.println(line+"\n");
    if (line.equals("Bye"))
    break;
    if (line.equals(""))
    continue;
    else
    System.out.println(line+"\n"); /*Print the line that has come in the
    socket*/
    ostream.close();
    fromclient.close();
    catch(Exception e)
    System.out.println("Cannot listen to the client" + e);
    I hope somebody can help me out .
    Thanx in advance
    Regards
    Sanket Gupta

    You don't seem to properly close the server socket any where. Here why don't you look at this skeleton. This may help you.
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class server
         static boolean listen = true;
         public static void main(String args[])
              try
                   ServerSocket ss = new ServerSocket(2156);
                   do
                        new serverThread(ss.accept()).start();
                   while(listen);
                   ss.close();
              catch(IOException e)
                   System.err.println(e.getMessage());
         public static void shutdown()
              listen = false;
    class serverThread extends Thread
         private Socket client;
         private String input;
         private BufferedReader in;
         private PrintWriter out;
         public serverThread(Socket c)
              client = c;
         public void run()
            try
              in = new BufferedReader(new InputStreamReader(client.getInputStream()));
              out = new PrintWriter(client.getOutputStream(),true);
              input = in.readLine();
              if(input.equals("Hello"))
                   out.println("How are you doing?");
              else if(input.equals("shutdown!"))
                   server.shutdown();
              else
                   out.println("Bad Request!");
              in.close();
              out.close();
              client.close();
            catch(IOException e)
                 System.err.println(e.getMessage());
    }

  • Using slim and xfce4, something crashes on exit

    I recently did a fresh install of Arch onto an older PC that I have. It's running a P4 3.06GHz, an nVidia GeForce FX 5900, and 1GB RAM. Because of the lower resources, I decided to use xfce4 and slim. I have a monitor and TV hooked up through s-video with the "seperate X screen" option. Whenever I logout of xfce (this includes, logout, reboot, shutdown), it goes to a blank black screen with a cursor at the top left and just hangs. I have slim configured to run from inittab, so it picks up after a couple seconds. However, if I run startx from console, and then logout of xfce the system just hangs and wont accept any keyboard input (including ctrl+alt+function to switch run levels). Also, if I choose to shutdown or reboot, the system will do so but the only thing I see is the blank screen until the POST. If I do a startx from console, the logout, I'm able to ssh in from my laptop, login and issue a reboot (again the screen doesn't change until the POST). Also, if I turn the "seperate x screen" option off, and just run the desktop on the monitor, it doesn't freeze. I've worked my way through a number of issues so far, but this one has me completely stumped. I'm not sure if there's something wrong with my configuration or if it's just a problem with the graphics driver. Any advice and/or help is greatly appreciated.
    Here are configuration and log files:
    Xorg.conf
    # nvidia-settings: X configuration file generated by nvidia-settings
    # nvidia-settings: version 1.0 (buildmeister@builder75) Wed Jan 27 03:03:53 PST 2010
    Section "ServerLayout"
    Identifier "X.org Configured"
    Screen 0 "Screen0" 0 0
    Screen 1 "Screen1" RightOf "Screen0"
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
    Option "BlankTime" "0"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "0"
    EndSection
    Section "Files"
    ModulePath "/usr/lib/xorg/modules"
    FontPath "/usr/share/fonts/misc"
    FontPath "/usr/share/fonts/100dpi:unscaled"
    FontPath "/usr/share/fonts/75dpi:unscaled"
    FontPath "/usr/share/fonts/TTF"
    FontPath "/usr/share/fonts/Type1"
    EndSection
    Section "Module"
    Load "glx"
    Load "dri2"
    Load "dri"
    Load "dbe"
    Load "record"
    Load "extmod"
    EndSection
    Section "ServerFlags"
    Option "Xinerama" "0"
    EndSection
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/input/mice"
    Option "ZAxisMapping" "4 5 6 7"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    Option "DPI" "95 x 96"
    ModelName "CMO CMC 17 AD"
    HorizSync 30.0 - 82.0
    VertRefresh 50.0 - 75.0
    EndSection
    Section "Monitor"
    Identifier "Monitor1"
    VendorName "Unknown"
    ModelName "TV-0"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    EndSection
    Section "Device"
    Identifier "Card0"
    Driver "nvidia"
    VendorName "nVidia Corporation"
    BoardName "NV35 [GeForce FX 5900]"
    BusID "PCI:1:0:0"
    EndSection
    Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce FX 5900"
    BusID "PCI:1:0:0"
    Screen 0
    EndSection
    Section "Device"
    Identifier "Videocard1"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce FX 5900"
    BusID "PCI:1:0:0"
    Screen 1
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "TwinView" "0"
    Option "TwinViewXineramaInfoOrder" "CRT-0"
    Option "metamodes" "CRT: nvidia-auto-select +0+0"
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    Section "Screen"
    Identifier "Screen1"
    Device "Videocard1"
    Monitor "Monitor1"
    DefaultDepth 24
    Option "TwinView" "0"
    Option "metamodes" "TV: nvidia-auto-select +0+0"
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    slim.conf
    # Path, X server and arguments (if needed)
    # Note: -xauth $authfile is automatically appended
    default_path ./:/bin:/usr/bin:/usr/local/bin
    default_xserver /usr/bin/X
    xserver_arguments -nolisten tcp vt07
    # Commands for halt, login, etc.
    halt_cmd /sbin/shutdown -h now
    reboot_cmd /sbin/shutdown -r now
    console_cmd /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
    #suspend_cmd /usr/sbin/suspend
    # Full path to the xauth binary
    xauth_path /usr/bin/xauth
    # Xauth file for server
    authfile /var/run/slim.auth
    # Activate numlock when slim starts. Valid values: on|off
    # numlock on
    # Hide the mouse cursor (note: does not work with some WMs).
    # Valid values: true|false
    # hidecursor false
    # This command is executed after a succesful login.
    # you can place the %session and %theme variables
    # to handle launching of specific commands in .xinitrc
    # depending of chosen session and slim theme
    # NOTE: if your system does not have bash you need
    # to adjust the command according to your preferred shell,
    # i.e. for freebsd use:
    # login_cmd exec /bin/sh - ~/.xinitrc %session
    login_cmd exec /bin/bash -login ~/.xinitrc %session
    # Commands executed when starting and exiting a session.
    # They can be used for registering a X11 session with
    # sessreg. You can use the %user variable
    sessionstart_cmd /usr/bin/sessreg -a -l $DISPLAY %user
    sessionstop_cmd /usr/bin/sessreg -d -l $DISPLAY %user
    # Start in daemon mode. Valid values: yes | no
    # Note that this can be overriden by the command line
    # options "-d" and "-nodaemon"
    # daemon yes
    # Available sessions (first one is the default).
    # The current chosen session name is replaced in the login_cmd
    # above, so your login command can handle different sessions.
    # see the xinitrc.sample file shipped with slim sources
    sessions xfce4,icewm,wmaker,blackbox
    # Executed when pressing F11 (requires imagemagick)
    screenshot_cmd import -window root /slim.png
    # welcome message. Available variables: %host, %domain
    welcome_msg Welcome to %host
    # Session message. Prepended to the session name when pressing F1
    # session_msg Session:
    # shutdown / reboot messages
    shutdown_msg The system is halting...
    reboot_msg The system is rebooting...
    # default user, leave blank or remove this line
    # for avoid pre-loading the username.
    default_user desktopuser
    # Focus the password field on start when default_user is set
    # Set to "yes" to enable this feature
    focus_password yes
    # Automatically login the default user (without entering
    # the password. Set to "yes" to enable this feature
    auto_login yes
    # current theme, use comma separated list to specify a set to
    # randomly choose from
    current_theme default
    # Lock file
    lockfile /var/lock/slim.lock
    # Log file
    logfile /var/log/slim.log
    slim.log isolated reboot
    /usr/bin/xauth: creating new authority file /var/run/slim.auth
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.5.902 (1.7.6 RC 2)
    Release Date: 2010-03-12
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux ArchDaemon 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686
    Kernel command line: root=/dev/disk/by-uuid/49d062ba-9f7b-4d18-98f2-87249f723889 ro 5 acpi_enforce_resources=lax vga=771
    Build Date: 13 March 2010 07:33:22PM
    Current version of pixman: 0.16.6
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Mar 19 14:07:00 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    /usr/bin/xauth: creating new authority file /home/desktopuser/.Xauthority
    /usr/bin/startxfce4: X server already running on display :0.0
    /tmp/xrdb_dysqQd:1: error: Unknown #directive "Those"
    # Those are fallback settings, use the ui plugin to change it
    /tmp/xrdb_dysqQd:2: error: Unknown #directive "or"
    # or add your overrides to ~/.Xresources
    /tmp/xrdb_dysqQd:3: error: Unknown #directive "Xft"
    # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
    /tmp/xrdb_dysqQd:4: error: Unknown #directive "Xft"
    # Xft hinting: 1/0
    4 errors in preprocessor.
    xrdb: "Xft.hinting" on line 9 overrides entry on line 6
    xrdb: "Xft.hintstyle" on line 11 overrides entry on line 7
    /tmp/xrdb_dysqQd:1: error: Unknown #directive "Those"
    # Those are fallback settings, use the ui plugin to change it
    /tmp/xrdb_dysqQd:2: error: Unknown #directive "or"
    # or add your overrides to ~/.Xresources
    /tmp/xrdb_dysqQd:3: error: Unknown #directive "Xft"
    # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
    /tmp/xrdb_dysqQd:4: error: Unknown #directive "Xft"
    # Xft hinting: 1/0
    4 errors in preprocessor.
    xrdb: "Xft.hinting" on line 9 overrides entry on line 6
    xrdb: "Xft.hintstyle" on line 11 overrides entry on line 7
    Agent pid 1617
    xfdesktop[1637]: starting up
    (xfce4-settings-helper:1639): GLib-GObject-CRITICAL **: g_param_spec_flags: assertion `G_TYPE_IS_FLAGS (flags_type)' failed
    (xfce4-settings-helper:1639): GLib-GObject-CRITICAL **: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed
    slim.log isolated logout
    slim: waiting for X server to shut down..........
    slim: X server slow to shut down, sending KILL signal.
    slim: waiting for server to die
    /usr/bin/xauth: creating new authority file /var/run/slim.auth
    slim: waiting for X server to begin accepting connections
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.5.902 (1.7.6 RC 2)
    Release Date: 2010-03-12
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux ArchDaemon 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686
    Kernel command line: root=/dev/disk/by-uuid/49d062ba-9f7b-4d18-98f2-87249f723889 ro 5 acpi_enforce_resources=lax vga=771
    Build Date: 13 March 2010 07:33:22PM
    Current version of pixman: 0.16.6
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Mar 19 14:01:03 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    Xorg.0.log
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.5.902 (1.7.6 RC 2)
    Release Date: 2010-03-12
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux ArchDaemon 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686
    Kernel command line: root=/dev/disk/by-uuid/49d062ba-9f7b-4d18-98f2-87249f723889 ro 5 acpi_enforce_resources=lax vga=771
    Build Date: 13 March 2010 07:33:22PM
    Current version of pixman: 0.16.6
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Mar 19 18:39:41 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    (==) ServerLayout "X.org Configured"
    (**) |-->Screen "Screen0" (0)
    (**) | |-->Monitor "Monitor0"
    (**) | |-->Device "Videocard0"
    (**) |-->Screen "Screen1" (1)
    (**) | |-->Monitor "Monitor1"
    (**) | |-->Device "Videocard1"
    (**) |-->Input Device "Mouse0"
    (**) |-->Input Device "Keyboard0"
    (**) Option "BlankTime" "0"
    (**) Option "StandbyTime" "0"
    (**) Option "SuspendTime" "0"
    (**) Option "OffTime" "0"
    (**) Option "Xinerama" "0"
    (==) Automatically adding devices
    (==) Automatically enabling devices
    (**) FontPath set to:
    /usr/share/fonts/misc,
    /usr/share/fonts/100dpi:unscaled,
    /usr/share/fonts/75dpi:unscaled,
    /usr/share/fonts/TTF,
    /usr/share/fonts/Type1,
    /usr/share/fonts/misc,
    /usr/share/fonts/100dpi:unscaled,
    /usr/share/fonts/75dpi:unscaled,
    /usr/share/fonts/TTF,
    /usr/share/fonts/Type1
    (**) ModulePath set to "/usr/lib/xorg/modules"
    (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    (WW) Disabling Mouse0
    (WW) Disabling Keyboard0
    (II) Loader magic: 0x81e4c40
    (II) Module ABI versions:
    X.Org ANSI C Emulation: 0.4
    X.Org Video Driver: 6.0
    X.Org XInput driver : 7.0
    X.Org Server Extension : 2.0
    (++) using VT number 7
    (--) PCI:*(0:1:0:0) 10de:0331:0000:0000 nVidia Corporation NV35 [GeForce FX 5900] rev 161, Mem @ 0xfd000000/16777216, 0xe0000000/134217728, BIOS @ 0x????????/131072
    (--) PCI: (0:2:10:0) 4444:0016:0070:b7f3 Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder rev 1, Mem @ 0xf0000000/67108864
    (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
    (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
    (II) "record" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dri" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
    (II) LoadModule: "glx"
    (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    (II) Module glx: vendor="NVIDIA Corporation"
    compiled for 4.0.2, module version = 1.0.0
    Module class: X.Org Server Extension
    (II) NVIDIA GLX Module 173.14.25 Wed Jan 27 02:59:37 PST 2010
    (II) Loading extension GLX
    (II) LoadModule: "dri2"
    (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    (II) Module dri2: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.1.0
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension DRI2
    (II) LoadModule: "dri"
    (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    (II) Module dri: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension XFree86-DRI
    (II) LoadModule: "dbe"
    (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    (II) Module dbe: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension DOUBLE-BUFFER
    (II) LoadModule: "record"
    (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    (II) Module record: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.13.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension RECORD
    (II) LoadModule: "extmod"
    (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    (II) Module extmod: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension MIT-SCREEN-SAVER
    (II) Loading extension XFree86-VidModeExtension
    (II) Loading extension XFree86-DGA
    (II) Loading extension DPMS
    (II) Loading extension XVideo
    (II) Loading extension XVideo-MotionCompensation
    (II) Loading extension X-Resource
    (II) LoadModule: "nvidia"
    (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    (II) Module nvidia: vendor="NVIDIA Corporation"
    compiled for 4.0.2, module version = 1.0.0
    Module class: X.Org Video Driver
    (II) NVIDIA dlloader X Driver 173.14.25 Wed Jan 27 02:34:38 PST 2010
    (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    (II) Primary Device is: PCI 01@00:00:0
    (II) Loading sub module "fb"
    (II) LoadModule: "fb"
    (II) Loading /usr/lib/xorg/modules/libfb.so
    (II) Module fb: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    ABI class: X.Org ANSI C Emulation, version 0.4
    (II) Loading sub module "wfb"
    (II) LoadModule: "wfb"
    (II) Loading /usr/lib/xorg/modules/libwfb.so
    (II) Module wfb: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    ABI class: X.Org ANSI C Emulation, version 0.4
    (II) Loading sub module "ramdac"
    (II) LoadModule: "ramdac"
    (II) Module "ramdac" already built-in
    (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    (==) NVIDIA(0): RGB weight 888
    (==) NVIDIA(0): Default visual is TrueColor
    (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    (**) NVIDIA(0): Option "TwinView" "0"
    (**) NVIDIA(0): Option "MetaModes" "CRT: nvidia-auto-select +0+0"
    (**) NVIDIA(0): Option "TwinViewXineramaInfoOrder" "CRT-0"
    (**) NVIDIA(0): Option "DPI" "95 x 96"
    (**) NVIDIA(0): Enabling RENDER acceleration
    (II) NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
    (II) NVIDIA(0): enabled.
    (II) NVIDIA(0): NVIDIA GPU GeForce FX 5900 (NV35) at PCI:1:0:0 (GPU-0)
    (--) NVIDIA(0): Memory: 131072 kBytes
    (--) NVIDIA(0): VideoBIOS: 04.35.20.18.04
    (II) NVIDIA(0): Detected AGP rate: 8X
    (--) NVIDIA(0): Interlaced video modes are supported on this GPU
    (--) NVIDIA(0): Connected display device(s) on GeForce FX 5900 at PCI:1:0:0:
    (--) NVIDIA(0): CMO CMC 17" AD (CRT-0)
    (--) NVIDIA(0): NVIDIA TV Encoder (TV-0)
    (--) NVIDIA(0): CMO CMC 17" AD (CRT-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(0): NVIDIA TV Encoder (TV-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(0): TV encoder: NVIDIA
    (II) NVIDIA(0): Display Device found referenced in MetaMode: CRT-0
    (II) NVIDIA(0): Assigned Display Device: CRT-0
    (II) NVIDIA(0): Validated modes:
    (II) NVIDIA(0): "CRT:nvidia-auto-select+0+0"
    (II) NVIDIA(0): Virtual screen size determined to be 1280 x 1024
    (**) NVIDIA(0): DPI set to (95, 96); computed from "DPI" X config option
    (==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
    (**) NVIDIA(1): Depth 24, (--) framebuffer bpp 32
    (==) NVIDIA(1): RGB weight 888
    (==) NVIDIA(1): Default visual is TrueColor
    (==) NVIDIA(1): Using gamma correction (1.0, 1.0, 1.0)
    (**) NVIDIA(1): Option "TwinView" "0"
    (**) NVIDIA(1): Option "MetaModes" "TV: nvidia-auto-select +0+0"
    (**) NVIDIA(1): Enabling RENDER acceleration
    (II) NVIDIA(1): NVIDIA GPU GeForce FX 5900 (NV35) at PCI:1:0:0 (GPU-0)
    (--) NVIDIA(1): Memory: 131072 kBytes
    (--) NVIDIA(1): VideoBIOS: 04.35.20.18.04
    (II) NVIDIA(1): Detected AGP rate: 8X
    (--) NVIDIA(1): Interlaced video modes are supported on this GPU
    (--) NVIDIA(1): Connected display device(s) on GeForce FX 5900 at PCI:1:0:0:
    (--) NVIDIA(1): CMO CMC 17" AD (CRT-0)
    (--) NVIDIA(1): NVIDIA TV Encoder (TV-0)
    (--) NVIDIA(1): CMO CMC 17" AD (CRT-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(1): NVIDIA TV Encoder (TV-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(1): TV encoder: NVIDIA
    (II) NVIDIA(1): Display Device found referenced in MetaMode: TV-0
    (II) NVIDIA(1): Assigned Display Device: TV-0
    (II) NVIDIA(1): Validated modes:
    (II) NVIDIA(1): "TV:nvidia-auto-select+0+0"
    (II) NVIDIA(1): Virtual screen size determined to be 1024 x 768
    (==) NVIDIA(1): DPI set to (75, 75); computed from built-in default
    (==) NVIDIA(1): Enabling 32-bit ARGB GLX visuals.
    (--) Depth 24 pixmap format is 32 bpp
    (II) NVIDIA(0): Initialized AGP GART.
    (II) NVIDIA(0): Unable to connect to the ACPI daemon; the ACPI daemon may not
    (II) NVIDIA(0): be running or the "AcpidSocketPath" X configuration option
    (II) NVIDIA(0): may not be set correctly. When the ACPI daemon is
    (II) NVIDIA(0): available, the NVIDIA X driver can use it to receive ACPI
    (II) NVIDIA(0): events. For details, please see the "ConnectToAcpid" and
    (II) NVIDIA(0): "AcpidSocketPath" X configuration options in Appendix B: X
    (II) NVIDIA(0): Config Options in the README.
    (II) NVIDIA(0): Setting mode "CRT:nvidia-auto-select+0+0"
    (II) Loading extension NV-GLX
    (II) NVIDIA(0): NVIDIA 3D Acceleration Architecture Initialized
    (II) NVIDIA(0): Using the NVIDIA 2D acceleration architecture
    (==) NVIDIA(0): Backing store disabled
    (==) NVIDIA(0): Silken mouse enabled
    (==) NVIDIA(0): DPMS enabled
    (II) Loading extension NV-CONTROL
    (==) RandR enabled
    (II) NVIDIA(1): Initialized AGP GART.
    (II) NVIDIA(1): Unable to connect to the ACPI daemon; the ACPI daemon may not
    (II) NVIDIA(1): be running or the "AcpidSocketPath" X configuration option
    (II) NVIDIA(1): may not be set correctly. When the ACPI daemon is
    (II) NVIDIA(1): available, the NVIDIA X driver can use it to receive ACPI
    (II) NVIDIA(1): events. For details, please see the "ConnectToAcpid" and
    (II) NVIDIA(1): "AcpidSocketPath" X configuration options in Appendix B: X
    (II) NVIDIA(1): Config Options in the README.
    (II) NVIDIA(1): Setting mode "TV:nvidia-auto-select+0+0"
    (II) NVIDIA(1): NVIDIA 3D Acceleration Architecture Initialized
    (II) NVIDIA(1): Using the NVIDIA 2D acceleration architecture
    (==) NVIDIA(1): Backing store disabled
    (==) NVIDIA(1): Silken mouse enabled
    (==) NVIDIA(1): DPMS enabled
    (==) RandR enabled
    (II) Initializing built-in extension Generic Event Extension
    (II) Initializing built-in extension SHAPE
    (II) Initializing built-in extension MIT-SHM
    (II) Initializing built-in extension XInputExtension
    (II) Initializing built-in extension XTEST
    (II) Initializing built-in extension BIG-REQUESTS
    (II) Initializing built-in extension SYNC
    (II) Initializing built-in extension XKEYBOARD
    (II) Initializing built-in extension XC-MISC
    (II) Initializing built-in extension SECURITY
    (II) Initializing built-in extension XINERAMA
    (II) Initializing built-in extension XFIXES
    (II) Initializing built-in extension RENDER
    (II) Initializing built-in extension RANDR
    (II) Initializing built-in extension COMPOSITE
    (II) Initializing built-in extension DAMAGE
    (II) Initializing extension GLX
    (II) config/hal: Adding input device Macintosh mouse button emulation
    (II) LoadModule: "evdev"
    (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    (II) Module evdev: vendor="X.Org Foundation"
    compiled for 1.7.3, module version = 2.3.2
    Module class: X.Org XInput Driver
    ABI class: X.Org XInput driver, version 7.0
    (**) Macintosh mouse button emulation: always reports core events
    (**) Macintosh mouse button emulation: Device: "/dev/input/event0"
    (II) Macintosh mouse button emulation: Found 3 mouse buttons
    (II) Macintosh mouse button emulation: Found relative axes
    (II) Macintosh mouse button emulation: Found x and y relative axes
    (II) Macintosh mouse button emulation: Configuring as mouse
    (**) Macintosh mouse button emulation: YAxisMapping: buttons 4 and 5
    (**) Macintosh mouse button emulation: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Macintosh mouse button emulation" (type: MOUSE)
    (**) Macintosh mouse button emulation: (accel) keeping acceleration scheme 1
    (**) Macintosh mouse button emulation: (accel) acceleration profile 0
    (II) Macintosh mouse button emulation: initialized for relative axes.
    (II) config/hal: Adding input device AT Translated Set 2 keyboard
    (**) AT Translated Set 2 keyboard: always reports core events
    (**) AT Translated Set 2 keyboard: Device: "/dev/input/event1"
    (II) AT Translated Set 2 keyboard: Found keys
    (II) AT Translated Set 2 keyboard: Configuring as keyboard
    (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Microsoft Microsoft Wireless Optical Desktop® 1.00
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: always reports core events
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: Device: "/dev/input/event6"
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found 9 mouse buttons
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found scroll wheel(s)
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found relative axes
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found x and y relative axes
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found keys
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Configuring as mouse
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Configuring as keyboard
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: YAxisMapping: buttons 4 and 5
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Microsoft Microsoft Wireless Optical Desktop® 1.00" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: (accel) keeping acceleration scheme 1
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: (accel) acceleration profile 0
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: initialized for relative axes.
    (II) config/hal: Adding input device Microsoft Microsoft Wireless Optical Desktop® 1.00
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: always reports core events
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: Device: "/dev/input/event5"
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found keys
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Microsoft Microsoft Wireless Optical Desktop® 1.00" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Power Button
    (**) Power Button: always reports core events
    (**) Power Button: Device: "/dev/input/event2"
    (II) Power Button: Found keys
    (II) Power Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Power Button
    (**) Power Button: always reports core events
    (**) Power Button: Device: "/dev/input/event3"
    (II) Power Button: Found keys
    (II) Power Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    errors from errors.log, this stuff just repeats
    Mar 19 15:44:43 ArchDaemon kernel: ACPI: I/O resource smsc47m1 [0x680-0x6ff] conflicts with ACPI region IOPM [0x680-0x6ff]
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Unable to open firmware v4l-cx2341x-enc.fw (must be 376836 bytes)
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Did you put the firmware in the hotplug firmware directory?
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Unable to open firmware v4l-cx2341x-enc.fw (must be 376836 bytes)
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Did you put the firmware in the hotplug firmware directory?
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 3
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 0
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 1
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 2
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 2
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 0
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 3
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 1
    Mar 19 18:39:22 ArchDaemon kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    Mar 19 18:39:22 ArchDaemon kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    Mar 19 18:39:30 ArchDaemon kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    errors common in auth.log
    Mar 19 13:10:25 ArchDaemon sudo: desktopuser : pam_authenticate: Conversation error ; TTY=unknown ; PWD=/home/desktopuser ; USER=root ; COMMAND=/usr/lib/xfce4/xfsm-shutdown-helper
    Mar 19 13:10:30 ArchDaemon dbus-daemon: Rejected send message, 1 matched rules; type="method_call", sender=":1.10" (uid=1001 pid=1567 comm="exo-mount) interface="org.freedesktop.Hal.Device.Volume" member="Mount" error name="(unset)" requested_reply=0 destination="org.freedesktop.Hal" (uid=0 pid=1336 comm="/usr/sbin/hald))

    I recently did a fresh install of Arch onto an older PC that I have. It's running a P4 3.06GHz, an nVidia GeForce FX 5900, and 1GB RAM. Because of the lower resources, I decided to use xfce4 and slim. I have a monitor and TV hooked up through s-video with the "seperate X screen" option. Whenever I logout of xfce (this includes, logout, reboot, shutdown), it goes to a blank black screen with a cursor at the top left and just hangs. I have slim configured to run from inittab, so it picks up after a couple seconds. However, if I run startx from console, and then logout of xfce the system just hangs and wont accept any keyboard input (including ctrl+alt+function to switch run levels). Also, if I choose to shutdown or reboot, the system will do so but the only thing I see is the blank screen until the POST. If I do a startx from console, the logout, I'm able to ssh in from my laptop, login and issue a reboot (again the screen doesn't change until the POST). Also, if I turn the "seperate x screen" option off, and just run the desktop on the monitor, it doesn't freeze. I've worked my way through a number of issues so far, but this one has me completely stumped. I'm not sure if there's something wrong with my configuration or if it's just a problem with the graphics driver. Any advice and/or help is greatly appreciated.
    Here are configuration and log files:
    Xorg.conf
    # nvidia-settings: X configuration file generated by nvidia-settings
    # nvidia-settings: version 1.0 (buildmeister@builder75) Wed Jan 27 03:03:53 PST 2010
    Section "ServerLayout"
    Identifier "X.org Configured"
    Screen 0 "Screen0" 0 0
    Screen 1 "Screen1" RightOf "Screen0"
    InputDevice "Mouse0" "CorePointer"
    InputDevice "Keyboard0" "CoreKeyboard"
    Option "BlankTime" "0"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "0"
    EndSection
    Section "Files"
    ModulePath "/usr/lib/xorg/modules"
    FontPath "/usr/share/fonts/misc"
    FontPath "/usr/share/fonts/100dpi:unscaled"
    FontPath "/usr/share/fonts/75dpi:unscaled"
    FontPath "/usr/share/fonts/TTF"
    FontPath "/usr/share/fonts/Type1"
    EndSection
    Section "Module"
    Load "glx"
    Load "dri2"
    Load "dri"
    Load "dbe"
    Load "record"
    Load "extmod"
    EndSection
    Section "ServerFlags"
    Option "Xinerama" "0"
    EndSection
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    EndSection
    Section "InputDevice"
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/input/mice"
    Option "ZAxisMapping" "4 5 6 7"
    EndSection
    Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    Option "DPI" "95 x 96"
    ModelName "CMO CMC 17 AD"
    HorizSync 30.0 - 82.0
    VertRefresh 50.0 - 75.0
    EndSection
    Section "Monitor"
    Identifier "Monitor1"
    VendorName "Unknown"
    ModelName "TV-0"
    HorizSync 28.0 - 33.0
    VertRefresh 43.0 - 72.0
    EndSection
    Section "Device"
    Identifier "Card0"
    Driver "nvidia"
    VendorName "nVidia Corporation"
    BoardName "NV35 [GeForce FX 5900]"
    BusID "PCI:1:0:0"
    EndSection
    Section "Device"
    Identifier "Videocard0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce FX 5900"
    BusID "PCI:1:0:0"
    Screen 0
    EndSection
    Section "Device"
    Identifier "Videocard1"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce FX 5900"
    BusID "PCI:1:0:0"
    Screen 1
    EndSection
    Section "Screen"
    Identifier "Screen0"
    Device "Videocard0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "TwinView" "0"
    Option "TwinViewXineramaInfoOrder" "CRT-0"
    Option "metamodes" "CRT: nvidia-auto-select +0+0"
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    Section "Screen"
    Identifier "Screen1"
    Device "Videocard1"
    Monitor "Monitor1"
    DefaultDepth 24
    Option "TwinView" "0"
    Option "metamodes" "TV: nvidia-auto-select +0+0"
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection
    slim.conf
    # Path, X server and arguments (if needed)
    # Note: -xauth $authfile is automatically appended
    default_path ./:/bin:/usr/bin:/usr/local/bin
    default_xserver /usr/bin/X
    xserver_arguments -nolisten tcp vt07
    # Commands for halt, login, etc.
    halt_cmd /sbin/shutdown -h now
    reboot_cmd /sbin/shutdown -r now
    console_cmd /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
    #suspend_cmd /usr/sbin/suspend
    # Full path to the xauth binary
    xauth_path /usr/bin/xauth
    # Xauth file for server
    authfile /var/run/slim.auth
    # Activate numlock when slim starts. Valid values: on|off
    # numlock on
    # Hide the mouse cursor (note: does not work with some WMs).
    # Valid values: true|false
    # hidecursor false
    # This command is executed after a succesful login.
    # you can place the %session and %theme variables
    # to handle launching of specific commands in .xinitrc
    # depending of chosen session and slim theme
    # NOTE: if your system does not have bash you need
    # to adjust the command according to your preferred shell,
    # i.e. for freebsd use:
    # login_cmd exec /bin/sh - ~/.xinitrc %session
    login_cmd exec /bin/bash -login ~/.xinitrc %session
    # Commands executed when starting and exiting a session.
    # They can be used for registering a X11 session with
    # sessreg. You can use the %user variable
    sessionstart_cmd /usr/bin/sessreg -a -l $DISPLAY %user
    sessionstop_cmd /usr/bin/sessreg -d -l $DISPLAY %user
    # Start in daemon mode. Valid values: yes | no
    # Note that this can be overriden by the command line
    # options "-d" and "-nodaemon"
    # daemon yes
    # Available sessions (first one is the default).
    # The current chosen session name is replaced in the login_cmd
    # above, so your login command can handle different sessions.
    # see the xinitrc.sample file shipped with slim sources
    sessions xfce4,icewm,wmaker,blackbox
    # Executed when pressing F11 (requires imagemagick)
    screenshot_cmd import -window root /slim.png
    # welcome message. Available variables: %host, %domain
    welcome_msg Welcome to %host
    # Session message. Prepended to the session name when pressing F1
    # session_msg Session:
    # shutdown / reboot messages
    shutdown_msg The system is halting...
    reboot_msg The system is rebooting...
    # default user, leave blank or remove this line
    # for avoid pre-loading the username.
    default_user desktopuser
    # Focus the password field on start when default_user is set
    # Set to "yes" to enable this feature
    focus_password yes
    # Automatically login the default user (without entering
    # the password. Set to "yes" to enable this feature
    auto_login yes
    # current theme, use comma separated list to specify a set to
    # randomly choose from
    current_theme default
    # Lock file
    lockfile /var/lock/slim.lock
    # Log file
    logfile /var/log/slim.log
    slim.log isolated reboot
    /usr/bin/xauth: creating new authority file /var/run/slim.auth
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.5.902 (1.7.6 RC 2)
    Release Date: 2010-03-12
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux ArchDaemon 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686
    Kernel command line: root=/dev/disk/by-uuid/49d062ba-9f7b-4d18-98f2-87249f723889 ro 5 acpi_enforce_resources=lax vga=771
    Build Date: 13 March 2010 07:33:22PM
    Current version of pixman: 0.16.6
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Mar 19 14:07:00 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    /usr/bin/xauth: creating new authority file /home/desktopuser/.Xauthority
    /usr/bin/startxfce4: X server already running on display :0.0
    /tmp/xrdb_dysqQd:1: error: Unknown #directive "Those"
    # Those are fallback settings, use the ui plugin to change it
    /tmp/xrdb_dysqQd:2: error: Unknown #directive "or"
    # or add your overrides to ~/.Xresources
    /tmp/xrdb_dysqQd:3: error: Unknown #directive "Xft"
    # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
    /tmp/xrdb_dysqQd:4: error: Unknown #directive "Xft"
    # Xft hinting: 1/0
    4 errors in preprocessor.
    xrdb: "Xft.hinting" on line 9 overrides entry on line 6
    xrdb: "Xft.hintstyle" on line 11 overrides entry on line 7
    /tmp/xrdb_dysqQd:1: error: Unknown #directive "Those"
    # Those are fallback settings, use the ui plugin to change it
    /tmp/xrdb_dysqQd:2: error: Unknown #directive "or"
    # or add your overrides to ~/.Xresources
    /tmp/xrdb_dysqQd:3: error: Unknown #directive "Xft"
    # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
    /tmp/xrdb_dysqQd:4: error: Unknown #directive "Xft"
    # Xft hinting: 1/0
    4 errors in preprocessor.
    xrdb: "Xft.hinting" on line 9 overrides entry on line 6
    xrdb: "Xft.hintstyle" on line 11 overrides entry on line 7
    Agent pid 1617
    xfdesktop[1637]: starting up
    (xfce4-settings-helper:1639): GLib-GObject-CRITICAL **: g_param_spec_flags: assertion `G_TYPE_IS_FLAGS (flags_type)' failed
    (xfce4-settings-helper:1639): GLib-GObject-CRITICAL **: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed
    slim.log isolated logout
    slim: waiting for X server to shut down..........
    slim: X server slow to shut down, sending KILL signal.
    slim: waiting for server to die
    /usr/bin/xauth: creating new authority file /var/run/slim.auth
    slim: waiting for X server to begin accepting connections
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.5.902 (1.7.6 RC 2)
    Release Date: 2010-03-12
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux ArchDaemon 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686
    Kernel command line: root=/dev/disk/by-uuid/49d062ba-9f7b-4d18-98f2-87249f723889 ro 5 acpi_enforce_resources=lax vga=771
    Build Date: 13 March 2010 07:33:22PM
    Current version of pixman: 0.16.6
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Mar 19 14:01:03 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    Xorg.0.log
    This is a pre-release version of the X server from The X.Org Foundation.
    It is not supported in any way.
    Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
    Select the "xorg" product for bugs you find in this release.
    Before reporting bugs in pre-release versions please check the
    latest version in the X.Org Foundation git repository.
    See http://wiki.x.org/wiki/GitPage for git access instructions.
    X.Org X Server 1.7.5.902 (1.7.6 RC 2)
    Release Date: 2010-03-12
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 2.6.33-ARCH i686
    Current Operating System: Linux ArchDaemon 2.6.32-ARCH #1 SMP PREEMPT Mon Mar 15 20:08:25 UTC 2010 i686
    Kernel command line: root=/dev/disk/by-uuid/49d062ba-9f7b-4d18-98f2-87249f723889 ro 5 acpi_enforce_resources=lax vga=771
    Build Date: 13 March 2010 07:33:22PM
    Current version of pixman: 0.16.6
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Fri Mar 19 18:39:41 2010
    (==) Using config file: "/etc/X11/xorg.conf"
    (==) ServerLayout "X.org Configured"
    (**) |-->Screen "Screen0" (0)
    (**) | |-->Monitor "Monitor0"
    (**) | |-->Device "Videocard0"
    (**) |-->Screen "Screen1" (1)
    (**) | |-->Monitor "Monitor1"
    (**) | |-->Device "Videocard1"
    (**) |-->Input Device "Mouse0"
    (**) |-->Input Device "Keyboard0"
    (**) Option "BlankTime" "0"
    (**) Option "StandbyTime" "0"
    (**) Option "SuspendTime" "0"
    (**) Option "OffTime" "0"
    (**) Option "Xinerama" "0"
    (==) Automatically adding devices
    (==) Automatically enabling devices
    (**) FontPath set to:
    /usr/share/fonts/misc,
    /usr/share/fonts/100dpi:unscaled,
    /usr/share/fonts/75dpi:unscaled,
    /usr/share/fonts/TTF,
    /usr/share/fonts/Type1,
    /usr/share/fonts/misc,
    /usr/share/fonts/100dpi:unscaled,
    /usr/share/fonts/75dpi:unscaled,
    /usr/share/fonts/TTF,
    /usr/share/fonts/Type1
    (**) ModulePath set to "/usr/lib/xorg/modules"
    (WW) AllowEmptyInput is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
    (WW) Disabling Mouse0
    (WW) Disabling Keyboard0
    (II) Loader magic: 0x81e4c40
    (II) Module ABI versions:
    X.Org ANSI C Emulation: 0.4
    X.Org Video Driver: 6.0
    X.Org XInput driver : 7.0
    X.Org Server Extension : 2.0
    (++) using VT number 7
    (--) PCI:*(0:1:0:0) 10de:0331:0000:0000 nVidia Corporation NV35 [GeForce FX 5900] rev 161, Mem @ 0xfd000000/16777216, 0xe0000000/134217728, BIOS @ 0x????????/131072
    (--) PCI: (0:2:10:0) 4444:0016:0070:b7f3 Internext Compression Inc iTVC16 (CX23416) MPEG-2 Encoder rev 1, Mem @ 0xf0000000/67108864
    (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
    (II) "extmod" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
    (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
    (II) "record" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dri" will be loaded. This was enabled by default and also specified in the config file.
    (II) "dri2" will be loaded. This was enabled by default and also specified in the config file.
    (II) LoadModule: "glx"
    (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    (II) Module glx: vendor="NVIDIA Corporation"
    compiled for 4.0.2, module version = 1.0.0
    Module class: X.Org Server Extension
    (II) NVIDIA GLX Module 173.14.25 Wed Jan 27 02:59:37 PST 2010
    (II) Loading extension GLX
    (II) LoadModule: "dri2"
    (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    (II) Module dri2: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.1.0
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension DRI2
    (II) LoadModule: "dri"
    (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    (II) Module dri: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension XFree86-DRI
    (II) LoadModule: "dbe"
    (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
    (II) Module dbe: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension DOUBLE-BUFFER
    (II) LoadModule: "record"
    (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    (II) Module record: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.13.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension RECORD
    (II) LoadModule: "extmod"
    (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    (II) Module extmod: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    Module class: X.Org Server Extension
    ABI class: X.Org Server Extension, version 2.0
    (II) Loading extension MIT-SCREEN-SAVER
    (II) Loading extension XFree86-VidModeExtension
    (II) Loading extension XFree86-DGA
    (II) Loading extension DPMS
    (II) Loading extension XVideo
    (II) Loading extension XVideo-MotionCompensation
    (II) Loading extension X-Resource
    (II) LoadModule: "nvidia"
    (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    (II) Module nvidia: vendor="NVIDIA Corporation"
    compiled for 4.0.2, module version = 1.0.0
    Module class: X.Org Video Driver
    (II) NVIDIA dlloader X Driver 173.14.25 Wed Jan 27 02:34:38 PST 2010
    (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    (II) Primary Device is: PCI 01@00:00:0
    (II) Loading sub module "fb"
    (II) LoadModule: "fb"
    (II) Loading /usr/lib/xorg/modules/libfb.so
    (II) Module fb: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    ABI class: X.Org ANSI C Emulation, version 0.4
    (II) Loading sub module "wfb"
    (II) LoadModule: "wfb"
    (II) Loading /usr/lib/xorg/modules/libwfb.so
    (II) Module wfb: vendor="X.Org Foundation"
    compiled for 1.7.5.902, module version = 1.0.0
    ABI class: X.Org ANSI C Emulation, version 0.4
    (II) Loading sub module "ramdac"
    (II) LoadModule: "ramdac"
    (II) Module "ramdac" already built-in
    (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    (==) NVIDIA(0): RGB weight 888
    (==) NVIDIA(0): Default visual is TrueColor
    (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    (**) NVIDIA(0): Option "TwinView" "0"
    (**) NVIDIA(0): Option "MetaModes" "CRT: nvidia-auto-select +0+0"
    (**) NVIDIA(0): Option "TwinViewXineramaInfoOrder" "CRT-0"
    (**) NVIDIA(0): Option "DPI" "95 x 96"
    (**) NVIDIA(0): Enabling RENDER acceleration
    (II) NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
    (II) NVIDIA(0): enabled.
    (II) NVIDIA(0): NVIDIA GPU GeForce FX 5900 (NV35) at PCI:1:0:0 (GPU-0)
    (--) NVIDIA(0): Memory: 131072 kBytes
    (--) NVIDIA(0): VideoBIOS: 04.35.20.18.04
    (II) NVIDIA(0): Detected AGP rate: 8X
    (--) NVIDIA(0): Interlaced video modes are supported on this GPU
    (--) NVIDIA(0): Connected display device(s) on GeForce FX 5900 at PCI:1:0:0:
    (--) NVIDIA(0): CMO CMC 17" AD (CRT-0)
    (--) NVIDIA(0): NVIDIA TV Encoder (TV-0)
    (--) NVIDIA(0): CMO CMC 17" AD (CRT-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(0): NVIDIA TV Encoder (TV-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(0): TV encoder: NVIDIA
    (II) NVIDIA(0): Display Device found referenced in MetaMode: CRT-0
    (II) NVIDIA(0): Assigned Display Device: CRT-0
    (II) NVIDIA(0): Validated modes:
    (II) NVIDIA(0): "CRT:nvidia-auto-select+0+0"
    (II) NVIDIA(0): Virtual screen size determined to be 1280 x 1024
    (**) NVIDIA(0): DPI set to (95, 96); computed from "DPI" X config option
    (==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
    (**) NVIDIA(1): Depth 24, (--) framebuffer bpp 32
    (==) NVIDIA(1): RGB weight 888
    (==) NVIDIA(1): Default visual is TrueColor
    (==) NVIDIA(1): Using gamma correction (1.0, 1.0, 1.0)
    (**) NVIDIA(1): Option "TwinView" "0"
    (**) NVIDIA(1): Option "MetaModes" "TV: nvidia-auto-select +0+0"
    (**) NVIDIA(1): Enabling RENDER acceleration
    (II) NVIDIA(1): NVIDIA GPU GeForce FX 5900 (NV35) at PCI:1:0:0 (GPU-0)
    (--) NVIDIA(1): Memory: 131072 kBytes
    (--) NVIDIA(1): VideoBIOS: 04.35.20.18.04
    (II) NVIDIA(1): Detected AGP rate: 8X
    (--) NVIDIA(1): Interlaced video modes are supported on this GPU
    (--) NVIDIA(1): Connected display device(s) on GeForce FX 5900 at PCI:1:0:0:
    (--) NVIDIA(1): CMO CMC 17" AD (CRT-0)
    (--) NVIDIA(1): NVIDIA TV Encoder (TV-0)
    (--) NVIDIA(1): CMO CMC 17" AD (CRT-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(1): NVIDIA TV Encoder (TV-0): 400.0 MHz maximum pixel clock
    (--) NVIDIA(1): TV encoder: NVIDIA
    (II) NVIDIA(1): Display Device found referenced in MetaMode: TV-0
    (II) NVIDIA(1): Assigned Display Device: TV-0
    (II) NVIDIA(1): Validated modes:
    (II) NVIDIA(1): "TV:nvidia-auto-select+0+0"
    (II) NVIDIA(1): Virtual screen size determined to be 1024 x 768
    (==) NVIDIA(1): DPI set to (75, 75); computed from built-in default
    (==) NVIDIA(1): Enabling 32-bit ARGB GLX visuals.
    (--) Depth 24 pixmap format is 32 bpp
    (II) NVIDIA(0): Initialized AGP GART.
    (II) NVIDIA(0): Unable to connect to the ACPI daemon; the ACPI daemon may not
    (II) NVIDIA(0): be running or the "AcpidSocketPath" X configuration option
    (II) NVIDIA(0): may not be set correctly. When the ACPI daemon is
    (II) NVIDIA(0): available, the NVIDIA X driver can use it to receive ACPI
    (II) NVIDIA(0): events. For details, please see the "ConnectToAcpid" and
    (II) NVIDIA(0): "AcpidSocketPath" X configuration options in Appendix B: X
    (II) NVIDIA(0): Config Options in the README.
    (II) NVIDIA(0): Setting mode "CRT:nvidia-auto-select+0+0"
    (II) Loading extension NV-GLX
    (II) NVIDIA(0): NVIDIA 3D Acceleration Architecture Initialized
    (II) NVIDIA(0): Using the NVIDIA 2D acceleration architecture
    (==) NVIDIA(0): Backing store disabled
    (==) NVIDIA(0): Silken mouse enabled
    (==) NVIDIA(0): DPMS enabled
    (II) Loading extension NV-CONTROL
    (==) RandR enabled
    (II) NVIDIA(1): Initialized AGP GART.
    (II) NVIDIA(1): Unable to connect to the ACPI daemon; the ACPI daemon may not
    (II) NVIDIA(1): be running or the "AcpidSocketPath" X configuration option
    (II) NVIDIA(1): may not be set correctly. When the ACPI daemon is
    (II) NVIDIA(1): available, the NVIDIA X driver can use it to receive ACPI
    (II) NVIDIA(1): events. For details, please see the "ConnectToAcpid" and
    (II) NVIDIA(1): "AcpidSocketPath" X configuration options in Appendix B: X
    (II) NVIDIA(1): Config Options in the README.
    (II) NVIDIA(1): Setting mode "TV:nvidia-auto-select+0+0"
    (II) NVIDIA(1): NVIDIA 3D Acceleration Architecture Initialized
    (II) NVIDIA(1): Using the NVIDIA 2D acceleration architecture
    (==) NVIDIA(1): Backing store disabled
    (==) NVIDIA(1): Silken mouse enabled
    (==) NVIDIA(1): DPMS enabled
    (==) RandR enabled
    (II) Initializing built-in extension Generic Event Extension
    (II) Initializing built-in extension SHAPE
    (II) Initializing built-in extension MIT-SHM
    (II) Initializing built-in extension XInputExtension
    (II) Initializing built-in extension XTEST
    (II) Initializing built-in extension BIG-REQUESTS
    (II) Initializing built-in extension SYNC
    (II) Initializing built-in extension XKEYBOARD
    (II) Initializing built-in extension XC-MISC
    (II) Initializing built-in extension SECURITY
    (II) Initializing built-in extension XINERAMA
    (II) Initializing built-in extension XFIXES
    (II) Initializing built-in extension RENDER
    (II) Initializing built-in extension RANDR
    (II) Initializing built-in extension COMPOSITE
    (II) Initializing built-in extension DAMAGE
    (II) Initializing extension GLX
    (II) config/hal: Adding input device Macintosh mouse button emulation
    (II) LoadModule: "evdev"
    (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    (II) Module evdev: vendor="X.Org Foundation"
    compiled for 1.7.3, module version = 2.3.2
    Module class: X.Org XInput Driver
    ABI class: X.Org XInput driver, version 7.0
    (**) Macintosh mouse button emulation: always reports core events
    (**) Macintosh mouse button emulation: Device: "/dev/input/event0"
    (II) Macintosh mouse button emulation: Found 3 mouse buttons
    (II) Macintosh mouse button emulation: Found relative axes
    (II) Macintosh mouse button emulation: Found x and y relative axes
    (II) Macintosh mouse button emulation: Configuring as mouse
    (**) Macintosh mouse button emulation: YAxisMapping: buttons 4 and 5
    (**) Macintosh mouse button emulation: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Macintosh mouse button emulation" (type: MOUSE)
    (**) Macintosh mouse button emulation: (accel) keeping acceleration scheme 1
    (**) Macintosh mouse button emulation: (accel) acceleration profile 0
    (II) Macintosh mouse button emulation: initialized for relative axes.
    (II) config/hal: Adding input device AT Translated Set 2 keyboard
    (**) AT Translated Set 2 keyboard: always reports core events
    (**) AT Translated Set 2 keyboard: Device: "/dev/input/event1"
    (II) AT Translated Set 2 keyboard: Found keys
    (II) AT Translated Set 2 keyboard: Configuring as keyboard
    (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Microsoft Microsoft Wireless Optical Desktop® 1.00
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: always reports core events
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: Device: "/dev/input/event6"
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found 9 mouse buttons
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found scroll wheel(s)
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found relative axes
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found x and y relative axes
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found keys
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Configuring as mouse
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Configuring as keyboard
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: YAxisMapping: buttons 4 and 5
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
    (II) XINPUT: Adding extended input device "Microsoft Microsoft Wireless Optical Desktop® 1.00" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: (accel) keeping acceleration scheme 1
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: (accel) acceleration profile 0
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: initialized for relative axes.
    (II) config/hal: Adding input device Microsoft Microsoft Wireless Optical Desktop® 1.00
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: always reports core events
    (**) Microsoft Microsoft Wireless Optical Desktop® 1.00: Device: "/dev/input/event5"
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Found keys
    (II) Microsoft Microsoft Wireless Optical Desktop® 1.00: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Microsoft Microsoft Wireless Optical Desktop® 1.00" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Power Button
    (**) Power Button: always reports core events
    (**) Power Button: Device: "/dev/input/event2"
    (II) Power Button: Found keys
    (II) Power Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    (II) config/hal: Adding input device Power Button
    (**) Power Button: always reports core events
    (**) Power Button: Device: "/dev/input/event3"
    (II) Power Button: Found keys
    (II) Power Button: Configuring as keyboard
    (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD)
    (**) Option "xkb_rules" "evdev"
    (**) Option "xkb_model" "evdev"
    (**) Option "xkb_layout" "us"
    errors from errors.log, this stuff just repeats
    Mar 19 15:44:43 ArchDaemon kernel: ACPI: I/O resource smsc47m1 [0x680-0x6ff] conflicts with ACPI region IOPM [0x680-0x6ff]
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Unable to open firmware v4l-cx2341x-enc.fw (must be 376836 bytes)
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Did you put the firmware in the hotplug firmware directory?
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Unable to open firmware v4l-cx2341x-enc.fw (must be 376836 bytes)
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Did you put the firmware in the hotplug firmware directory?
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 3
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 0
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 1
    Mar 19 18:39:21 ArchDaemon kernel: ivtv0: Failed to initialize on minor 2
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 2
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 0
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 3
    Mar 19 18:39:22 ArchDaemon kernel: ivtv0: Failed to initialize on minor 1
    Mar 19 18:39:22 ArchDaemon kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    Mar 19 18:39:22 ArchDaemon kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    Mar 19 18:39:30 ArchDaemon kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
    errors common in auth.log
    Mar 19 13:10:25 ArchDaemon sudo: desktopuser : pam_authenticate: Conversation error ; TTY=unknown ; PWD=/home/desktopuser ; USER=root ; COMMAND=/usr/lib/xfce4/xfsm-shutdown-helper
    Mar 19 13:10:30 ArchDaemon dbus-daemon: Rejected send message, 1 matched rules; type="method_call", sender=":1.10" (uid=1001 pid=1567 comm="exo-mount) interface="org.freedesktop.Hal.Device.Volume" member="Mount" error name="(unset)" requested_reply=0 destination="org.freedesktop.Hal" (uid=0 pid=1336 comm="/usr/sbin/hald))

  • Reading large files -- use FileChannel or BufferedReader?

    Question --
    I need to read files and get their content. The issue is that I have no idea how big the files will be. My best guess is that most are less than 5kb but some with be huge.
    I have it set up using a BufferedReader, which is working fine. It's not the fastest thing (using readLine() and StringBuffer.append()), but so far it's usable. However, I'm worried that if I need to deal with large files, such as a PDF or other binary, BufferedReader won't be so efficient if I do it line by line. (And will I run into issues trying to put a binary file into a String?)
    I found a post that recommended FileChannel and ByteBuffer, but I'm running into a java.lang.UnsupportedOperationException when trying to get the byte[] from ByteBuffer.
    File f = new File(binFileName);
    FileInputStream fis = new FileInputStream(f);
    FileChannel fc = fis.getChannel();
    // Get the file's size and then map it into memory
    int sz = (int)fc.size();
    MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, sz);
    fc.close();
    String contents = new String(bb.array()); //code blows up
    Thanks in advance.

    If all you are doing is reading data I don't think you're going to get much faster than InfoFetcher
    you are welcome to use and modify this class, but please don't change the package or take credit for it as your own work
    InfoFetcher.java
    ==============
    package tjacobs.io;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.ArrayList;
    import java.util.Iterator;
    * InfoFetcher is a generic way to read data from an input stream (file, socket, etc)
    * InfoFetcher can be set up with a thread so that it reads from an input stream
    * and report to registered listeners as it gets
    * more information. This vastly simplifies the process of always re-writing
    * the same code for reading from an input stream.
    * <p>
    * I use this all over
         public class InfoFetcher implements Runnable {
              public byte[] buf;
              public InputStream in;
              public int waitTime;
              private ArrayList mListeners;
              public int got = 0;
              protected boolean mClearBufferFlag = false;
              public InfoFetcher(InputStream in, byte[] buf, int waitTime) {
                   this.buf = buf;
                   this.in = in;
                   this.waitTime = waitTime;
              public void addInputStreamListener(InputStreamListener fll) {
                   if (mListeners == null) {
                        mListeners = new ArrayList(2);
                   if (!mListeners.contains(fll)) {
                        mListeners.add(fll);
              public void removeInputStreamListener(InputStreamListener fll) {
                   if (mListeners == null) {
                        return;
                   mListeners.remove(fll);
              public byte[] readCompletely() {
                   run();
                   return buf;
              public int got() {
                   return got;
              public void run() {
                   if (waitTime > 0) {
                        TimeOut to = new TimeOut(waitTime);
                        Thread t = new Thread(to);
                        t.start();
                   int b;
                   try {
                        while ((b = in.read()) != -1) {
                             if (got + 1 > buf.length) {
                                  buf = IOUtils.expandBuf(buf);
                             int start = got;
                             buf[got++] = (byte) b;
                             int available = in.available();
                             //System.out.println("got = " + got + " available = " + available + " buf.length = " + buf.length);
                             if (got + available > buf.length) {
                                  buf = IOUtils.expandBuf(buf, Math.max(got + available, buf.length * 2));
                             got += in.read(buf, got, available);
                             signalListeners(false, start);
                             if (mClearBufferFlag) {
                                  mClearBufferFlag = false;
                                  got = 0;
                   } catch (IOException iox) {
                        throw new PartialReadException(got, buf.length);
                   } finally {
                        buf = IOUtils.trimBuf(buf, got);
                        signalListeners(true);
              private void setClearBufferFlag(boolean status) {
                   mClearBufferFlag = status;
              public void clearBuffer() {
                   setClearBufferFlag(true);
              private void signalListeners(boolean over) {
                   signalListeners (over, 0);
              private void signalListeners(boolean over, int start) {
                   if (mListeners != null) {
                        Iterator i = mListeners.iterator();
                        InputStreamEvent ev = new InputStreamEvent(got, buf, start);
                        //System.out.println("got: " + got + " buf = " + new String(buf, 0, 20));
                        while (i.hasNext()) {
                             InputStreamListener fll = (InputStreamListener) i.next();
                             if (over) {
                                  fll.gotAll(ev);
                             } else {
                                  fll.gotMore(ev);
         }

  • Problem trying to read an SSL server socket stream using readByte().

    Hi I'm trying to read an SSL server socket stream using readByte(). I need to use readByte() because my program acts an LDAP proxy (receives LDAP messages from an LDAP client then passes them onto an actual LDAP server. It works fine with normal LDAP data streams but once an SSL data stream is introduced, readByte just hangs! Here is my code.....
    help!!! anyone?... anyone?
    1. SSL Socket is first read into  " InputStream input"
    public void     run()
              Authorization     auth = new Authorization();
              try     {
                   InputStream     input     =     client.getInputStream();
                   while     (true)
                   {     StandLdapCommand command;
                        try
                             command = new StandLdapCommand(input);
                             Authorization     t = command.get_auth();
                             if (t != null )
                                  auth = t;
                        catch( SocketException e )
                        {     // If socket error, drop the connection
                             Message.Info( "Client connection closed: " + e );
                             close( e );
                             break;
                        catch( EOFException e )
                        {     // If socket error, drop the connection
                             Message.Info( "Client connection close: " + e );
                             close( e );
                             break;
                        catch( Exception e )
                             //Way too many of these to trace them!
                             Message.Error( "Command not processed due to exception");
                             close( e );
                                            break;
                                            //continue;
                        processor.processBefore(auth,     command);
                                    try
                                      Thread.sleep(40); //yield to other threads
                                    catch(InterruptedException ie) {}
              catch     (Exception e)
                   close(e);
    2 Then data is sent to an intermediate function 
    from this statement in the function above:   command = new StandLdapCommand(input);
         public StandLdapCommand(InputStream     in)     throws IOException
              message     =     LDAPMessage.receive(in);
              analyze();
    Then finally, the read function where it hangs at  "int tag = (int)din.readByte(); "
    public static LDAPMessage receive(InputStream is) throws IOException
        *  LDAP Message Format =
        *      1.  LBER_SEQUENCE                           --  1 byte
        *      2.  Length                                  --  variable length     = 3 + 4 + 5 ....
        *      3.  ID                                      --  variable length
        *      4.  LDAP_REQ_msg                            --  1 byte
        *      5.  Message specific structure              --  variable length
        DataInputStream din = new DataInputStream(is);
           int tag = (int)din.readByte();      // sequence tag// sequence tag

    I suspect you are actually getting an Exception and not tracing the cause properly and then doing a sleep and then getting another Exception. Never ever catch an exception without tracing what it actually is somewhere.
    Also I don't know what the sleep is supposed to be for. You will block in readByte() until something comes in, and that should be enough yielding for anybody. The sleep is just literally a waste of time.

Maybe you are looking for

  • At random times (more so when afk) firefox will loose connection to the net. I have close and open firefox again to get it going. It will do this everytime i am using it.

    <blockquote>Locking duplicate thread.<br> Please continue here: [/questions/749757]<br> Thanks - c</blockquote><br> I have to do it also to other programs that use the net. This started to happen to me after I installed firefox. It never happened whi

  • ITunes 10 Will not Import CDs

    I just discovered that iTunes 10 will not import audio CDs. Once you insert the CD and iTunes launches, the CD disappears from the desktop. It is not there in the finder window nor in the iTunes window. This occured on all three Macs I tried it on an

  • Creating IDOC by Output type

    Hi Xperts, I've experienced cases of creating delivery idoc when sale order is created. This creation of idoc is triggered when an output type for the SO is determined. I want to understand how the configuration of Output type determines the corespon

  • Sun8.1 app server's behavior problem

    Sun8.1 app server's behavior is not good. I tried with the following scenario's. 1. Undelpoy one project: When I'm trying to undeploy one project, it is able to undeploy but, it is not able to remove folder from <<C:\Sun81>>\AppServer\domains\domain1

  • Joins in ALV

    Is it possible to use joins in alv?I mean if i want to display records from both pa0000 and pa0001 in one grid.I can put this into a internal table,pass it to reuse_alv_grid_display.How go to about structure name parameter in that function?Suggest me