|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.io.j2me.tcp.TCPConnection
public class TCPConnection
This class provides the "tcp" protocol for accessing the SPOT radio using TCP streams.
It is an implementor of StreamConnection
StreamConnection| Constructor Summary | |
|---|---|
TCPConnection()
DO NOT USE THIS CONSTRUCTOR - connections should be created using Connector.open(...) |
|
TCPConnection(String addr,
int portNo,
boolean isServer,
boolean timeouts)
DO NOT USE THIS CONSTRUCTOR - connections should be created using Connector.open(...) |
|
| Method Summary | |
|---|---|
void |
close()
Close the connection. |
int |
getLocalPort()
|
Inet6Address |
getRemoteAddress()
|
int |
getRemotePort()
|
long |
getTimeout()
Get the timeout for receiving information on this connection |
Connection |
open(String arg0,
String arg1,
int arg2,
boolean arg3)
|
DataInputStream |
openDataInputStream()
Open and return a data input stream for a connection. |
DataOutputStream |
openDataOutputStream()
Open and return a data output stream for a connection. |
InputStream |
openInputStream()
Open and return an input stream for a connection. |
OutputStream |
openOutputStream()
Open and return an output stream for a connection. |
void |
setTimeout(long time)
Set the timeout for receiving information on this connection |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TCPConnection(String addr,
int portNo,
boolean isServer,
boolean timeouts)
throws IOException
TCPConnection object.
addr - The IPv6 address of the remote end of the connection. If this is not specified
then this end of the connection is a server connection.portNo - The IPv6 TCP port number of the remote end of the connection. If this is a server
connection, this port number is the port number of this end of the server connection.isServer - Defines whether this is a server side connection.timeouts - The default timeout for socket operations.
IOExceptionpublic TCPConnection()
| Method Detail |
|---|
public InputStream openInputStream()
InputConnection
openInputStream in interface InputConnectionpublic OutputStream openOutputStream()
OutputConnection
openOutputStream in interface OutputConnectionpublic DataInputStream openDataInputStream()
InputConnection
openDataInputStream in interface InputConnectionpublic DataOutputStream openDataOutputStream()
OutputConnection
openDataOutputStream in interface OutputConnection
public void close()
throws IOException
Connection
When a connection has been closed, access to any of its methods
that involve an I/O operation will cause an IOException
to be thrown.
Closing an already closed connection has no effect. Streams
derived from the connection may be open when method is called.
Any open streams will cause the connection to be held open
until they themselves are closed. In this latter case access
to the open streams is permitted, but access to the connection
is not.
close in interface ConnectionIOException - If an I/O error occurs
public Connection open(String arg0,
String arg1,
int arg2,
boolean arg3)
throws IOException
IOExceptionpublic Inet6Address getRemoteAddress()
public int getLocalPort()
public int getRemotePort()
public long getTimeout()
ITimeoutableConnection
getTimeout in interface ITimeoutableConnectionpublic void setTimeout(long time)
ITimeoutableConnection
setTimeout in interface ITimeoutableConnectiontime - - Timeout period in milliseconds. Set this to -1 to turn off timeouts (infinite wait),
or to 0 or more to wait that long for data before throwing a TimeoutException.
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||