Http - Motorola C370 Series Technical Manual

J2me developer guide
Hide thumbs Also See for C370 Series:
Table of Contents

Advertisement

6
Network API
- boolean timeout –
IOException when it detects a time-out condition.
The time-out period for the TCP implementation on the Motorola C370, C450, and C550
series of handsets is 20 seconds on read operation and about 45 seconds on write
operation if the time-out flag is set to true. If the time-out flag is set to false, the time-out
time is indefinite. The lingering time for closing sockets is 0 second (if the socket closed
by the server the lingering time will be less than 100 ms). If a new socket is requested
within this time frame and the maximum number of sockets opened has been reached (5
sockets), then an IOException is thrown.
Applications requesting a network resource for any protocol must use one of the three
methods above. The URL is the distinguishing argument that determines the difference
between HTTP, etc. The following chart details the prefixes that should be used for the
supported protocols.
Protocol

HTTP

TCP Sockets
UDP Sockets
HTTP
The HTTP implementation follows the MIDP 1.0 standard. The
methods return a
reading and writing. The following is a code example to show implementation of HTTP:
HttpConnection hc = (HttpConnection)Connector.open(
"http://www.motorola.com");
In this particular example, the standard port 80 is used, but this parameter can be
specified as shown in the following example:
HttpConnection hc = (HttpConnection)Connector.open(
"http://www.motorola.com:8080");
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. By default,
HTTP 1.1 persistency is used to increase efficiency while requesting multiple pieces of
data from the same server. In order to disable persistency, set the "Connection" property
of the HTTP header to "close".
An optional third parameter, protocol may throw an
URL Format
http://
socket://
datagram://
object that is then used to open streams for
HttpConnection
Connector.open()
33

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents