Motorola C381P Manual De Usuario
![Motorola](https://files.manualsbrain.com/attachments/83de88ba2280e7232128e8931d7cbd2a38dcc654/common/fit/150/50/0293f422c4d32e7e0f777d5e11bc33c83ea5627f71ddf155374c02a23d9a/brand_logo.png)
8
Network APIs
Network APIs
32
}
while (bytes_read > 0);
} catch (Exception ex) {
System.out.println("IO failed: "+
ex.getMessage());
}
finally {
closeAllStreams(i); //clean up
}
}
while (bytes_read > 0);
} catch (Exception ex) {
System.out.println("IO failed: "+
ex.getMessage());
}
finally {
closeAllStreams(i); //clean up
}
}
Code Sample 2 Socket Connection
User Permission
The user of the handset will explicitly grant permission to add additional network
connections.
connections.
HTTPS Connection
Motorola implementation supports a HTTPS connection on the Motorola C381p handset.
Additional protocols that will be supported are the following:
Additional protocols that will be supported are the following:
• TLS protocol version 1.0 as defined in
http://www.ietf.org/rfc/rfc2246.txt
• SSL protocol version 3.0 as defined in
http://home.netscape.com/eng/ssl3/draft302.txt
The Code Sample 3 shows the implementation of HTTPS:
HTTPS
import javax.microedition.io.*;
import java.io.*;
import javax.microedition.midlet.*;
…
try {
hc[i] =
(HttpConnection)Connector.open(“https://” + url[i] + "/");
(HttpConnection)Connector.open(“https://” + url[i] + "/");
} catch (Exception ex) {
hc[i] = null;
System.out.println("Open Failed: " +
ex.getMessage());
ex.getMessage());
}
if (hc[i] != null)
{