Package com.hierynomus.smbj.connection
Class SequenceWindow
java.lang.Object
com.hierynomus.smbj.connection.SequenceWindow
[MS-SMB2] 3.2.4.1.6 Algorithm for Handling Available Message Sequence Numbers by the Client.
The client MUST implement an algorithm to manage message sequence numbers.
Sequence numbers are used to associate requests with responses and to determine what requests are allowed for processing.
The algorithm MUST meet the following conditions:
- When the connection is first established, the allowable sequence numbers for sending a request MUST be set to the set { 0 }.
- The client MUST never send a request on a given connection with a sequence number that has already been used unless it is a request to cancel a previously sent request.
- The client MUST grow the set in a monotonically increasing manner based on the credits granted. If the set is { 0 }, and 2 credits are granted, the set MUST grow to { 0, 1, 2 }.
- The client MUST use the lowest available sequence number in its allowable set for each request.
- For a multi-credit request as specified in section 3.2.4.1.5, the client MUST use the lowest available range of consecutive sequence numbers.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Semaphore
private AtomicLong
private static final long
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
void
creditsGranted
(int credits) (package private) void
(package private) long
get()
(package private) long[]
get
(int credits) private long[]
range
(long start, long stop)
-
Field Details
-
PREFERRED_MINIMUM_CREDITS
static final int PREFERRED_MINIMUM_CREDITS- See Also:
-
lowestAvailable
-
available
-
MAX_WAIT
private static final long MAX_WAIT- See Also:
-
-
Constructor Details
-
SequenceWindow
public SequenceWindow()
-
-
Method Details
-
get
long get() -
get
long[] get(int credits) -
disableCredits
void disableCredits() -
available
public int available() -
creditsGranted
public void creditsGranted(int credits) -
range
private long[] range(long start, long stop)
-