|
HOME | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This class represents the transport layer for client side Socket or DatagramSocket.
| Field Summary |
| Fields inherited from interface com.ireasoning.core.network.NetConst |
TCP, UDP |
| Method Summary | |
void |
close()
|
java.lang.String |
getHostName()
|
int |
getPort()
|
int |
getReceiveBufferSize()
|
int |
getType()
Returns the type of transport layer. |
boolean |
isConnected()
|
void |
open(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
Creates a client-side socket and connects it to the specified port number on the named host. |
void |
open(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectionTimeout)
Creates a client-side socket and connects it to the specified port number on the named host. |
int |
receive(TransportData data)
|
void |
send(java.lang.String str)
|
void |
send(TransportData data)
|
void |
setReceiveBufferSize(int size)
|
void |
setTimeout(int timeout)
|
void |
setTrafficClass(int tc)
Sets traffic class or type-of-service octet in the IP datagram header As the underlying network implementation may ignore this value applications should consider it a hint. |
| Method Detail |
public void send(TransportData data)
throws java.io.IOException
java.io.IOException
public void send(java.lang.String str)
throws java.io.IOException
java.io.IOException
public int receive(TransportData data)
throws java.io.IOException
java.io.IOException
public void open(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort)
throws java.io.IOException
host - the host name.port - the port number.
java.io.IOException
public void open(java.lang.String host,
int port,
java.net.InetAddress localAddr,
int localPort,
int connectionTimeout)
throws java.io.IOException
host - the host name.port - the port number.
java.io.IOExceptionpublic void close()
public void setTimeout(int timeout)
throws java.net.SocketException
java.net.SocketExceptionpublic boolean isConnected()
public void setReceiveBufferSize(int size)
public int getReceiveBufferSize()
public java.lang.String getHostName()
public int getPort()
public int getType()
public void setTrafficClass(int tc)
throws java.net.SocketException
tc - an int value for the bitset.
java.net.SocketExceptionhttp://java.sun.com/j2se/1.5.0/docs/api/java/net/DatagramSocket.html#setTrafficClass(int),
http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setTrafficClass%28int%29
|
HOME | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||