0 Replies Latest reply on Apr 5, 2011 4:05 PM by 852990

    J2ME Bluetooth javax.bluetooth.BluetoothConnectionException: Error in btspp

      I am working on a piece of coursework that is using bluetooth to create a multiplayer game however it seems to break after a minute or so and the following error occurs

      javax.bluetooth.BluetoothConnectionException: Error in btspp::connect ()

      All that is happening between the two phones is the following...

      try {
      dis = conn.openDataInputStream();
      EnemyX = dis.readUTF();
      EnemyY = dis.readUTF();
      System.out.println("Read Stream");

      } catch (IOException e) {
      System.err.println("Input Steam = " + e.getMessage());


      try {
      mDateConnect = mDiscoveryAgent.selectService(MARIO_JUMP_ID,
      ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);

      while (true) {
      conn = (StreamConnection) Connector.open(mDateConnect);
      dos = conn.openDataOutputStream();
      System.err.println("Output Sent");

      } catch (Exception ex) {
      System.err.println("BT ex= "+ ex);

      The Input stream does repeat on every loop I just haven't posted the full code (because its huge lol.) Also It is very slow to pass the players position between the phones, is there something else that should be done to speed up the connections?

      The most important thing is solving this error, it seems so send two read streams before the exception is caught and then from there the other phone is left waiting to connect.