Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4526515

ServerSocket exception, running out of buffer space

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • unknown
    • core-libs
    • None
    • x86
    • windows_98

      Customer says,
      Our software is designed with the JDK1.4.0 beta 2 and JDK1.4.0 beta 3.
      Our software uses several sockets and the problem seems to come from
      sockets. In fact, we can't allocate a ServerSocket. The ServerSocket has
      a listener waiting the connection on it. At creation, a
      java.lang.NullPointerException is thrwon. I have no StackTrace (only the
      exception).

      The test case does not show the java.lang.NullPointerException, but
      catches an exception "No buffer space avialable" after creating 17 server
      sockets. Problem only on windows 98 not on NT, win 2000 or Solaris.

      Test Case

      import java.net.Socket;
      import java.net.ServerSocket;
      import java.io.IOException;

      public class SocketCrasher
      {
          public static final int PORT_MIN = 9000 ;
          public static final int PORT_MAX = 10000 ;

          public static void main(String[] arg)
          {
              for (int i=PORT_MIN; i<PORT_MAX; i++)
              {
                  ServerSocket ss = null ;
                  try
                  {
                      System.out.print("Testing socket " + i + "...") ;
                      ss = new ServerSocket(i) ;
                      System.out.println(" Socket OK") ;
                  }
                  catch (IOException ioe)
                  {
                      System.out.println(" Socket Error") ;
                      ioe.printStackTrace();
                      System.exit(0);
                  }
              }
          }
      }

            michaelm Michael McMahon
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: