Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Průvodce řešením problémů Strana 125

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 286
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 124
125
7: Creating connections
keepGoing = false;
}
break;
default:
//The connection failed for some other reason.
//Handle failed connection.
keepGoing = false;
break;
}
}
//Close the connection.
s.close();
}
catch (IOException e)
{
//Handle the exception.
}
Use HTTPS connections
Use socket connections
Although you can implement HTTP over a socket connection, you should use an HTTP connection for the following
reasons:
Socket connections do not support the BlackBerry® Mobile Data System™ features, such as push.
Task Steps
Before opening an HTTPS connection,
verify that the BlackBerry® device is
within a wireless coverage area.
>Use the CoverageInfo class and CoverageStatusListener interface of the
net.rim.device.api.system package to make sure that the BlackBerry device is in a
wireless coverage area.
Open an HTTPS connection. 1. Invoke Connector.open(), specifying HTTPS as the protocol.
2. Cast the returned object as an HttpsConnection object.
HttpsConnection stream = (HttpsConnection)Connector.open("https://
host:443/");
Specify the connection mode. > To open an HTTPS connection in end-to-end mode, add one of the following parameters to the
connection string that passes to
Connector.open():
Specify that an end-to-end HTTPS connection must be used from the BlackBerry device to
the target server:
EndToEndRequired.
Specify that an end-to-end HTTPS connection should be used from the BlackBerry device
to the target server. If the BlackBerry device does not support end-to-end TLS, and the
BlackBerry device user permits proxy TLS connections, then a proxy connection is used:
EndToEndDesired.
HttpsConnection stream = (HttpsConnection)Connector.open("https://
host:443/;EndToEndDesired");
Zobrazit stránku 124
1 2 ... 120 121 122 123 124 125 126 127 128 129 130 ... 285 286

Komentáře k této Příručce

Žádné komentáře