3 Replies Latest reply on Jan 25, 2005 9:14 AM by 807596

    IOException Resource temporarily unavailable

    807596
      I have a program that opens a socket and listens for udp packets. The code snippet code goes like this

      while( true )
      {

      byte[] buf = new byte[ 2048 ];
      DatagramPacket p = new DatagramPacket( buf, buf.length );

      try { socket.receive( p ); }
      catch( IOException exc )
      {
      log("Socket read error: " + exc.getMessage());
      break;
      }
      //... do something with p
      }

      My program works fine until I get this "Resource temporarily unavailable" exception. (I dont use nio classes) Iam on linux 8.0 with JRE1.5..
      When does this exception occur ? Is there any workaround ? It looks like this would be thrown when no data is available on the socket (but I dont get this in Windows) Any help would be greatly appreciated.