|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.io.Connector
The Connector.open()
method returns a protocol-specific Connection object that is
then used
to transmit data. Before data transmission, the returned Connection
object must be typecast to a protocol-specific implementation object.
Class of
the returned Connection object is set in the protocol
scheme in the URL provided by the Connector.open() method.
The table below shows
all the protocol schemes supported by the Nokia 12 GSM module and the
returned Connection
class for each supported protocol.
Scheme |
Protocol |
Connection class |
Description and URL |
http |
HTTP |
HttpConnection |
HTTP connection over a TCP
bearer. http://www.example.com:80/index.html |
socket |
TCP |
StreamConnection |
TCP client connection. socket://10.35.1.195:9000 |
socket |
TCP |
StreamConnectionNotifier |
TCP server connection for
receiving incoming TCP connections socket://:9000 |
datagram |
UDP |
DatagramConnection |
UDP socket for sending and
receiving UDP datagrams. datagram://10.35.1.195:9000 datagram://:9000 |
comm |
Serial port |
StreamConnection |
Stream connection for sending
and receiving data using a built-in serial port. comm:3;baudrate=115200 |
sms |
SMS |
MessageConnection |
Message connection for
sending and receiving short messages. sms://+35812345678 sms://:3000 |
Field Summary | |
static int |
READ
Access mode READ. |
static int |
READ_WRITE
Access mode READ_WRITE. |
static int |
WRITE
Access mode WRITE. |
Method Summary | |
static Connection |
open(String name)
Create and open a Connection. |
static Connection |
open(String name,
int mode)
Create and open a Connection. |
static Connection |
open(String name,
int mode,
boolean timeouts)
Create and open a Connection. |
static DataInputStream |
openDataInputStream(String name)
Create and open a connection input stream. |
static DataOutputStream |
openDataOutputStream(String name)
Create and open a connection output stream. |
static InputStream |
openInputStream(String name)
Create and open a connection input stream. |
static OutputStream |
openOutputStream(String name)
Create and open a connection output stream. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int READ
public static final int WRITE
public static final int READ_WRITE
Method Detail |
public static Connection open(String name) throws IOException
name
- The URL for the connection.
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- If the requested connection
cannot be make, or the protocol type does not exist.
IOException
- If some other kind of I/O error occurs.public static Connection open(String name, int mode) throws IOException
name
- The URL for the connection.mode
- The access mode.
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- If the requested connection
cannot be make, or the protocol type does not exist.
IOException
- If some other kind of I/O error occurs.public static Connection open(String name, int mode, boolean timeouts) throws IOException
name
- The URL for the connectionmode
- The access modetimeouts
- A flag to indicate that the caller
wants timeout exceptions
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- if the requested connection
cannot be make, or the protocol type does not exist.
IOException
- If some other kind of I/O error occurs.public static DataInputStream openDataInputStream(String name) throws IOException
name
- The URL for the connection.
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- If the connection cannot
be found.
IOException
- If some other kind of I/O error occurs.public static DataOutputStream openDataOutputStream(String name) throws IOException
name
- The URL for the connection.
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- If the connection cannot
be found.
IOException
- If some other kind of I/O error occurs.public static InputStream openInputStream(String name) throws IOException
name
- The URL for the connection.
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- If the connection cannot
be found.
IOException
- If some other kind of I/O error occurs.public static OutputStream openOutputStream(String name) throws IOException
name
- The URL for the connection.
IllegalArgumentException
- If a parameter is invalid.
ConnectionNotFoundException
- If the connection cannot
be found.
IOException
- If some other kind of I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |