public class SESocket extends java.lang.Object implements Socket
| Modifier and Type | Field and Description |
|---|---|
protected java.io.InputStream |
in |
protected IPAddress |
ipAddress |
protected java.io.OutputStream |
out |
protected int |
port |
protected java.net.Socket |
socket |
| Modifier | Constructor and Description |
|---|---|
protected |
SESocket() |
|
SESocket(IPAddress host,
int port)
Default constructor.
|
|
SESocket(java.net.Socket socket,
IPAddress address) |
| 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. |
boolean |
isTcpNoDelayEnabled() |
void |
setTcpNoDelayEnabled(boolean tcpNoDelayEnabled) |
protected java.net.Socket socket
protected IPAddress ipAddress
protected int port
protected java.io.InputStream in
protected java.io.OutputStream out
public SESocket(IPAddress host, int port) throws java.io.IOException
host - host name.port - port number.java.io.IOExceptionpublic SESocket(java.net.Socket socket,
IPAddress address)
protected SESocket()
public void close()
throws java.io.IOException
Socketpublic java.io.InputStream getInputStream()
throws java.io.IOException
SocketgetInputStream in interface Socketjava.io.IOException - an I/O exception.public java.io.OutputStream getOutputStream()
throws java.io.IOException
SocketgetOutputStream in interface Socketjava.io.IOException - an I/O exception.public java.lang.String getRemoteAddress()
Socketnull
if it is disconnected. WARNING: CLDC does not support the remote address, so null
will always be returned for CLDC.getRemoteAddress in interface Socketpublic int getRemotePort()
Socket-1
if it is unconnected. WARNING: CLDC does not support the remote port, so you always get
-1 for CLDC.getRemotePort in interface Socketpublic CredentialInfo getRemoteCredentialInfo()
getRemoteCredentialInfo in interface Socketpublic IPAddress getLocalAddress()
SocketgetLocalAddress in interface Socketpublic int getLocalPort()
SocketgetLocalPort in interface Socketpublic boolean isTcpNoDelayEnabled()
public void setTcpNoDelayEnabled(boolean tcpNoDelayEnabled)