Package jade.mtp.http
Class KeepAlive
- java.lang.Object
-
- jade.mtp.http.KeepAlive
-
public class KeepAlive extends Object
This class represents a connection to a remote server
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeepAlive.KAConnection
-
Constructor Summary
Constructors Constructor Description KeepAlive(int dim, int outPort, boolean agressive)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(KeepAlive.KAConnection c)add a new connectionintcapacity()get the capacity of VectorsKeepAlive.KAConnectiongetConnection(HTTPAddress addr)get the socket of the connection when addr make matchingintgetDim()get the dimension of Vectorsvoidremove(HTTPAddress addr)delete an exisiting connection, based on its addressvoidremove(KeepAlive.KAConnection ka)delete an exisiting connectionvoidsend(HTTPAddress url, byte[] request)voidswap(KeepAlive.KAConnection c)
-
-
-
Method Detail
-
add
public void add(KeepAlive.KAConnection c)
add a new connection
-
remove
public void remove(HTTPAddress addr)
delete an exisiting connection, based on its address
-
remove
public void remove(KeepAlive.KAConnection ka)
delete an exisiting connection
-
getConnection
public KeepAlive.KAConnection getConnection(HTTPAddress addr)
get the socket of the connection when addr make matching
-
getDim
public int getDim()
get the dimension of Vectors
-
capacity
public int capacity()
get the capacity of Vectors
-
swap
public void swap(KeepAlive.KAConnection c)
-
send
public void send(HTTPAddress url, byte[] request) throws MTPException
- Throws:
MTPException
-
-