| Modifier and Type | Field and Description |
|---|---|
static long |
EXPIRES
1.
|
| Constructor and Description |
|---|
MemPool() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
appendArrival(Arrival task)
Append an arrival task into the pool after received something
|
boolean |
appendDeparture(Departure task)
Append a departure task into the pool after sent.
|
boolean |
deleteDeparture(Package response,
java.net.SocketAddress destination,
java.net.SocketAddress source)
Delete the departure task with 'trans_id' in the response.
|
java.util.List<Assemble> |
discardFragments()
Remove all expired fragments
|
int |
getCountOfArrivals()
Check how many arrivals waiting in the pool
|
Package |
insertFragment(Package fragment,
java.net.SocketAddress source,
java.net.SocketAddress destination)
Add a fragment package into the pool for MessageFragment received.
|
Departure |
shiftExpiredDeparture()
Gat one departure task from the pool for sending.
|
Arrival |
shiftFirstArrival()
Get one arrival task from the pool for processing
|
public static long EXPIRES
public Departure shiftExpiredDeparture()
PoolshiftExpiredDeparture in interface Poolpublic boolean appendDeparture(Departure task)
PoolappendDeparture in interface Pooltask - - depature taskpublic boolean deleteDeparture(Package response, java.net.SocketAddress destination, java.net.SocketAddress source)
PooldeleteDeparture in interface Poolresponse - - respond packagedestination - - remote IP and portsource - - local IP and portpublic int getCountOfArrivals()
PoolgetCountOfArrivals in interface Poolpublic Arrival shiftFirstArrival()
PoolshiftFirstArrival in interface Poolpublic boolean appendArrival(Arrival task)
PoolappendArrival in interface Pooltask - - arrival taskpublic Package insertFragment(Package fragment, java.net.SocketAddress source, java.net.SocketAddress destination)
PoolinsertFragment in interface Poolfragment - - message fragmentsource - - remote IP and portdestination - - local IP and portpublic java.util.List<Assemble> discardFragments()
discardFragments in interface Pool