Package com.hierynomus.smbj.connection
Class SequenceWindow
- java.lang.Object
-
- com.hierynomus.smbj.connection.SequenceWindow
-
public class SequenceWindow extends java.lang.Object
[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 Modifier and Type Class Description private static class
SequenceWindow.NoopSemaphore
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Semaphore
available
private java.util.concurrent.atomic.AtomicLong
lowestAvailable
private static long
MAX_WAIT
(package private) static int
PREFERRED_MINIMUM_CREDITS
-
Constructor Summary
Constructors Constructor Description SequenceWindow()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
creditsGranted(int credits)
(package private) void
disableCredits()
(package private) long
get()
(package private) long[]
get(int credits)
private long[]
range(long start, long stop)
-
-
-
Field Detail
-
PREFERRED_MINIMUM_CREDITS
static final int PREFERRED_MINIMUM_CREDITS
- See Also:
- Constant Field Values
-
lowestAvailable
private java.util.concurrent.atomic.AtomicLong lowestAvailable
-
available
private java.util.concurrent.Semaphore available
-
MAX_WAIT
private static final long MAX_WAIT
- See Also:
- Constant Field Values
-
-