Motorola i88s manual TCP Sockets, SSL Secure Sockets, ServerSockets

Models: i88s

1 29
Download 29 pages 17.63 Kb
Page 17
Image 17

Motorola Inc.

i88s J2ME Developers’ Guide

In this particular example, the standard port 443 is used, but this parameter can be specified as shown in the following example:

HttpConnection hc = (HttpConnection)Connector.open(“http://www.motorola.com:8888”);

The other static Connector methods work in the same manner, but they provide the application additional control in dealing with the properties of the connection.

Note – Only Verisign Certificates are supported in the i88s phone. The following is a list of supported features:

SSL 3.0

TLS 1.0

Server Authentication

2.2.3TCP Sockets

The low-level socket used to implement the higher-level HTTP protocol is exposed to applications via the Generic Connection Framework. The usage is similar to the examples above, however, a StreamConnection is returned by the Connection.open() method, as shown in the following example:

StreamConnection sc = (StreamConnection)Connector.open(“socket://www.motorola.com:8000”);

Although similar to HTTP, notice the required port number at the end of the remote address. In the previous protocols, those ports are well known and registered so they are not required, but in the case of low level sockets, this value is not defined. The port number is a required parameter for this protocol stack.

2.2.4SSL Secure Sockets

The low-level socket used to implement the higher-level HTTPS protocol is also exposed to applications via the Generic Connection Framework. The usage is similar to the examples above.

StreamConnection sc = (StreamConnection)Connector.open(“ssocket://www.motorola.com:8000”);

As with non-secure sockets, the port number is a required parameter for this protocol stack.

2.2.5ServerSockets

In addition to acting as a data requestor, some applications may act as data providers or servers. In order to accomplish this without workarounds or polling, a server type socket is required. The i88s phone provides this functionality within the GenericConnectionFramework. Opening a ServerSocket via the Connector object

Version 1.0 - Page 17

Page 17
Image 17
Motorola i88s manual TCP Sockets, SSL Secure Sockets, ServerSockets