| java.lang.Object java.io.OutputStream java.io.DataOutputStream com.sun.cdc.io.GeneralBase com.sun.cdc.io.ConnectionBase com.sun.cdc.io.j2me.socket.Protocol
All known Subclasses: com.sun.midp.io.j2me.socket.Protocol,
Method Summary | |
protected void | checkMIDPPermission(String host, int port) | public void | close() Close the connection. | public String | getAddress() Gets the remote address to which the socket is bound. | public String | getLocalAddress() Gets the local address to which the socket is bound. | public int | getLocalPort() Returns the local port to which this socket is bound. | public int | getPort() Returns the remote port to which this socket is bound. | public int | getSocketOption(byte option) Get a socket option for the connection. | public void | open(String name, int mode, boolean timeouts) | public void | open(Socket socket) | public InputStream | openInputStream() Returns an input stream for this socket. | public OutputStream | openOutputStream() Returns an output stream for this socket. | public Connection | openPrim(String name, int mode, boolean timeouts) | public void | setSocketOption(byte option, int value) Set a socket option for the connection.
Options inform the low level networking code about intended
usage patterns that the application will use in dealing with
the socket connection.
Calling setSocketOption to assign buffer sizes
is a hint to the platform of the sizes to set the underlying
network I/O buffers.
Calling getSocketOption can be used to see what
sizes the system is using.
The system MAY adjust the buffer sizes to account for
better throughput available from Maximum Transmission Unit
(MTU) and Maximum Segment Size (MSS) data available
from current network information.
Parameters: option - socket option identifier (KEEPALIVE, LINGER,SNDBUF, RCVBUF, or DELAY) Parameters: value - numeric value for specified option exception: IllegalArgumentException - if the value is notvalid (e.g. |
ipv6 | boolean ipv6(Code) | | IPv6 address
|
opens | int opens(Code) | | Open count
|
checkMIDPPermission | protected void checkMIDPPermission(String host, int port)(Code) | | |
close | public void close() throws IOException(Code) | | Close the connection.
exception: IOException - if an I/O error occurs when closing theconnection. |
getAddress | public String getAddress() throws IOException(Code) | | Gets the remote address to which the socket is bound.
The address can be either the remote host name or the IP
address(if available).
the remote address to which the socket is bound. exception: IOException - if the connection was closed. |
getLocalAddress | public String getLocalAddress() throws IOException(Code) | | Gets the local address to which the socket is bound.
The host address(IP number) that can be used to connect to this
end of the socket connection from an external system.
Since IP addresses may be dynamically assigned, a remote application
will need to be robust in the face of IP number reassignment.
The local hostname (if available) can be accessed from
System.getProperty("microedition.hostname")
the local address to which the socket is bound. exception: IOException - if the connection was closed. See Also: ServerSocketConnection |
getLocalPort | public int getLocalPort() throws IOException(Code) | | Returns the local port to which this socket is bound.
the local port number to which this socket is connected. exception: IOException - if the connection was closed. See Also: ServerSocketConnection |
getPort | public int getPort() throws IOException(Code) | | Returns the remote port to which this socket is bound.
the remote port number to which this socket is connected. exception: IOException - if the connection was closed. |
open | public void open(Socket socket) throws IOException(Code) | | Open the connection
Parameters: socket - an already formed socketThis function is only used by com.sun.kjava.system.palm.protocol.socketserver; |
openInputStream | public InputStream openInputStream() throws IOException(Code) | | Returns an input stream for this socket.
an input stream for reading bytes from this socket. exception: IOException - if an I/O error occurs when creating theinput stream. |
openOutputStream | public OutputStream openOutputStream() throws IOException(Code) | | Returns an output stream for this socket.
an output stream for writing bytes to this socket. exception: IOException - if an I/O error occurs when creating theoutput stream. |
openPrim | public Connection openPrim(String name, int mode, boolean timeouts) throws IOException(Code) | | Open the connection
Parameters: name - the target for the connection Parameters: writeable - a flag that is true if the caller expects to write to theconnection. Parameters: timeouts - A flag to indicate that the called wants timeout exceptionsThe name string for this protocol should be:": |
setSocketOption | public void setSocketOption(byte option, int value) throws IllegalArgumentException, IOException(Code) | | Set a socket option for the connection.
Options inform the low level networking code about intended
usage patterns that the application will use in dealing with
the socket connection.
Calling setSocketOption to assign buffer sizes
is a hint to the platform of the sizes to set the underlying
network I/O buffers.
Calling getSocketOption can be used to see what
sizes the system is using.
The system MAY adjust the buffer sizes to account for
better throughput available from Maximum Transmission Unit
(MTU) and Maximum Segment Size (MSS) data available
from current network information.
Parameters: option - socket option identifier (KEEPALIVE, LINGER,SNDBUF, RCVBUF, or DELAY) Parameters: value - numeric value for specified option exception: IllegalArgumentException - if the value is notvalid (e.g. negative value) or if the optionidentifier is not valid exception: IOException - if the connection was closed See Also: Protocol.getSocketOption |
|
|