public interface Pool
| 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 that belong to the incomplete messages,
which had waited a long time but still some fragments missed.
|
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
|
Departure shiftExpiredDeparture()
boolean appendDeparture(Departure task)
task - - depature taskboolean deleteDeparture(Package response, java.net.SocketAddress destination, java.net.SocketAddress source)
response - - respond packagedestination - - remote IP and portsource - - local IP and portint getCountOfArrivals()
Arrival shiftFirstArrival()
boolean appendArrival(Arrival task)
task - - arrival taskPackage insertFragment(Package fragment, java.net.SocketAddress source, java.net.SocketAddress destination)
fragment - - message fragmentsource - - remote IP and portdestination - - local IP and portjava.util.List<Assemble> discardFragments()