public class ConnectionOverTCP extends java.lang.Object implements Connection
Constructor and Description |
---|
ConnectionOverTCP(TCPEndPointDst dst)
Construct a ConnectionOverTCP given a TCPEndPointDst
|
ConnectionOverTCP(TCPEndPointSrc src)
Construct a ConnectionOverTCP given a TCPEndPointSrc
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection -- must be synchronized to prevent close while
we are in sendDatagram
|
boolean |
connect()
Connect.
|
Address |
getAddress()
Get the Address for this connection.
|
EndPoint |
getEndPoint()
Get the EndPoint of this Connection.
|
java.net.Socket |
getSocket()
Get the socket.
|
Datagram |
readDatagram()
Read a Datagram.
|
boolean |
sendDatagram(Datagram dg)
Send datagram down channel -- must be synchronized to prevent close occuring
when this is working
|
Connection |
setAddress(Address addr)
Set the Address for this connection.
|
java.lang.String |
toString()
To String
|
boolean |
writeBytesToChannel(java.nio.ByteBuffer bb) |
public ConnectionOverTCP(TCPEndPointSrc src) throws java.io.IOException
java.io.IOException
public ConnectionOverTCP(TCPEndPointDst dst) throws java.io.IOException
java.io.IOException
public boolean connect() throws java.io.IOException
connect
in interface Connection
java.io.IOException
public Address getAddress()
getAddress
in interface Connection
public Connection setAddress(Address addr)
setAddress
in interface Connection
public boolean sendDatagram(Datagram dg) throws java.io.IOException, java.nio.channels.ClosedByInterruptException
sendDatagram
in interface Connection
java.io.IOException
java.nio.channels.ClosedByInterruptException
public boolean writeBytesToChannel(java.nio.ByteBuffer bb) throws java.io.IOException
java.io.IOException
public Datagram readDatagram() throws java.io.IOException
readDatagram
in interface Connection
java.io.IOException
public void close()
public EndPoint getEndPoint()
getEndPoint
in interface Connection
public java.net.Socket getSocket()
public java.lang.String toString()
toString
in class java.lang.Object
User Space Routing 0.10.3