P ort naming convention has been changed in S60 3rd Edition FP 2 and
newer – port numbering starts from 1 and not from 0. Legacy MIDlets using
hard coded port number 0 will not work anymore. They will receive SecurityException
when
port is opened.
The following table specifies the GCF Connections and the protocols used for implementing them in S60.
Connection interface |
Networking protocol used for S60 |
---|---|
HttpConnection |
HTTP or WAP WSP protocol |
HttpsConnection |
HTTPS (i.e. HTTP over TLS) or WAP WTLS (WSP) protocol |
SecureConnection |
TLS or SSLv3 |
ServerSocketConnection |
TCP/IP (server side) |
SocketConnection (TCP) |
TCP/IP (client side) |
UDPDatagramConnection |
UDP/IP |
CommConnection |
physical RS-232 serial port, IrDA IrCOMM, USB, BT |
PushRegistry |
List of supported protocols:
|
Internet Access Point for connection is selected using following criteria when MIDlet opens network connection:
Use MIDlet specific Internet Access Point if defined. This can be set programmatically or via Application Manager.
Use default Java Internet Access Point if defined.
Use default Internet Access Point if defined.
Prompt user for Internet Access Point selection.
User is able to define Internet Access Point manually once the MIDlet is installed via MIDlet suite settings in Application Manager. User defined MIDlet specific Access Point is then used for all connections automatically.
Nokia proprietary IAP Info API gives applications access to Internet Access Point and Destination Network (i.e. access point group) related information. IAP Info API provides following information:
IAP related information (ID, type, name)
Destination network (ID, name, IAPs contained)
List of preferred Access Points
Last used Access Point (for socket connections)
For more information, see IAP Info API description.
Access point or network ID returned by IAP Info API can be used as an
additional parameter in URI when connection is opened. Following optional
parameters can be used with Connector.open()
:
nokia_apnid
for access point selection
nokia_netid
for network selection
Parameter nokia_netid
can be used only for socket
connections. The parameter names are case sensitive. If either of the parameters
is defined it must be at the end of the URI in the following format:
<protocol>://[<authority>]<path>[?[<query>>];{nokia_apnid=<number>>| nokia_netid=<number>}]
For example:
Connector.open("http://www.nokia.com:80; nokia_apnid=1");
Connector.open("socket://192.168.1.2:50; nokia_apnid=2");
Connector.open("socket://129.144.111.5:10; nokia_netid=3");
IAP selection prompt will be shown every time if the connection is opened using a host name. This is mainly because of the way native DNS resolver works.
A MIDlet can avoid additional IAP selection prompts when it reconnects to same host by storing resolved IP address in a variable, like in the code snippet below:
String url = "socket://host.com:79"; String address = ""; SocketConnection con = (SocketConnection)Connector.open(url); address = con.getAddress(); // IP address should be used in following connections // instead of host name
This workaround can be used with socket, ssl, http and https connections.