public interface Socket
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
java.io.InputStream |
getInputStream()
Returns an input stream for this socket.
|
IPAddress |
getLocalAddress()
Returns the local address for this socket.
|
int |
getLocalPort()
Returns the local port of this socket.
|
java.io.OutputStream |
getOutputStream()
Returns an output stream for this socket.
|
java.lang.String |
getRemoteAddress()
Returns the remote address of the endpoint that this socket is connected to, or
null
if it is disconnected. |
CredentialInfo |
getRemoteCredentialInfo() |
int |
getRemotePort()
Returns the remote port of the endpoint to which this socket is connected, or
-1
if it is unconnected. |
java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOException - an I/O exception.java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException - an I/O exception.void close()
throws java.io.IOException
java.io.IOException - an I/O exception.java.lang.String getRemoteAddress()
null
if it is disconnected. WARNING: CLDC does not support the remote address, so null
will always be returned for CLDC.int getRemotePort()
-1
if it is unconnected. WARNING: CLDC does not support the remote port, so you always get
-1 for CLDC.CredentialInfo getRemoteCredentialInfo()
IPAddress getLocalAddress()
int getLocalPort()