|
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()
|
String |
getHostName()
|
int |
getPort()
|
int |
getReceiveBufferSize()
|
int |
getType()
Returns the type of transport layer. |
boolean |
isConnected()
|
void |
open(String host,
int port,
InetAddress localAddr,
int localPort)
Creates a client-side socket and connects it to the specified port number on the named host. |
void |
open(String host,
int port,
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(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 IOException
IOException
public void send(String str) throws IOException
IOException
public int receive(TransportData data) throws IOException
IOException
public void open(String host, int port, InetAddress localAddr, int localPort) throws IOException
host
- the host name.port
- the port number.
IOException
public void open(String host, int port, InetAddress localAddr, int localPort, int connectionTimeout) throws IOException
host
- the host name.port
- the port number.
IOException
public void close()
public void setTimeout(int timeout) throws SocketException
SocketException
public boolean isConnected()
public void setReceiveBufferSize(int size)
public int getReceiveBufferSize()
public String getHostName()
public int getPort()
public int getType()
public void setTrafficClass(int tc) throws SocketException