diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.mdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.mdb.meta index 432ce29..6d28c93 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.mdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.mdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: e9f013cd847fa5144a1b8089fe0a7888 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: e9f013cd847fa5144a1b8089fe0a7888 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.meta index 3e863e4..a834046 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: ec820f421ab70614f92d92ce8266e58b -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: ec820f421ab70614f92d92ce8266e58b +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.pdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.pdb.meta index 43a7034..9199bc8 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.pdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.pdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: f115da9a4e605a04590cbbc5c46e416f -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: f115da9a4e605a04590cbbc5c46e416f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml index f23c85d..398152b 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml @@ -1,1978 +1,1978 @@ - - - - DotNetty.Buffers - - - - - - Abstract base class implementation of a - - - - - - Abstract base class for instances - - - - - - Abstract base class for implementations that wrap another - . - - - - - Returns a hex dump - of the specified buffer's sub-region. - - - - - Returns a hex dump - of the specified buffer's sub-region. - - - - - Returns a hex dump - of the specified buffer's sub-region. - - - - - Returns a hex dump - of the specified buffer's sub-region. - - - - - Calculates the hash code of the specified buffer. This method is - useful when implementing a new buffer type. - - - - - Returns the reader index of needle in haystack, or -1 if needle is not in haystack. - - - - - Returns {@code true} if and only if the two specified buffers are - identical to each other for {@code length} bytes starting at {@code aStartIndex} - index for the {@code a} buffer and {@code bStartIndex} index for the {@code b} buffer. - A more compact way to express this is: -

- {@code a[aStartIndex : aStartIndex + length] == b[bStartIndex : bStartIndex + length]} -

-
- - - Returns {@code true} if and only if the two specified buffers are - identical to each other as described in {@link ByteBuf#equals(Object)}. - This method is useful when implementing a new buffer type. - - - - - Compares the two specified buffers as described in {@link ByteBuf#compareTo(ByteBuf)}. - This method is useful when implementing a new buffer type. - - - - - The default implementation of . - This method is useful when implementing a new buffer type. - - - - - Read the given amount of bytes into a new {@link ByteBuf} that is allocated from the {@link ByteBufAllocator}. - - - - - Encode a string in http://en.wikipedia.org/wiki/UTF-8 and write it into reserveBytes of - a byte buffer. The reserveBytes must be computed (ie eagerly using {@link #utf8MaxBytes(string)} - or exactly with #utf8Bytes(string)}) to ensure this method not to not: for performance reasons - the index checks will be performed using just reserveBytes. - - This method returns the actual number of bytes written. - - - - Encode the given using the given into a new - which - is allocated via the . - - The to allocate {@link IByteBuffer}. - src The to encode. - charset The specified - - - - Encode the given using the given into a new - which - is allocated via the . - - The to allocate {@link IByteBuffer}. - src The to encode. - charset The specified - the extra capacity to alloc except the space for decoding. - - - - Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans. - - - - - Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans, - starting at the given {@code offset} using the given {@code length}. - - - - - Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified - {@link StringBuilder} that is easy to read by humans. - - - - - Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified - {@link StringBuilder} that is easy to read by humans, starting at the given {@code offset} using - the given {@code length}. - - - - - Toggles the endianness of the specified 64-bit long integer. - - - - - Toggles the endianness of the specified 32-bit integer. - - - - - Toggles the endianness of the specified 16-bit integer. - - - - - Default on most Windows systems - - - - - Add the given {@link IByteBuffer}. - Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. - If you need to have it increased you need to handle it by your own. - @param buffer the {@link IByteBuffer} to add - - - - - Add the given {@link IByteBuffer}s. - Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. - If you need to have it increased you need to handle it by your own. - @param buffers the {@link IByteBuffer}s to add - - - - - Add the given {@link IByteBuffer}s. - Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. - If you need to have it increased you need to handle it by your own. - @param buffers the {@link IByteBuffer}s to add - - - - - Add the given {@link IByteBuffer} on the specific index. - Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. - If you need to have it increased you need to handle it by your own. - @param cIndex the index on which the {@link IByteBuffer} will be added - @param buffer the {@link IByteBuffer} to add - - - - - Add the given {@link IByteBuffer}s on the specific index - Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. - If you need to have it increased you need to handle it by your own. - @param cIndex the index on which the {@link IByteBuffer} will be added. - @param buffers the {@link IByteBuffer}s to add - - - - - Add the given {@link ByteBuf}s on the specific index - Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. - If you need to have it increased you need to handle it by your own. - @param cIndex the index on which the {@link IByteBuffer} will be added. - @param buffers the {@link IByteBuffer}s to add - - - - - This should only be called as last operation from a method as this may adjust the underlying - array of components and so affect the index etc. - - - - - Remove the {@link IByteBuffer} from the given index. - @param cIndex the index on from which the {@link IByteBuffer} will be remove - - - - - Remove the number of {@link IByteBuffer}s starting from the given index. - @param cIndex the index on which the {@link IByteBuffer}s will be started to removed - @param numComponents the number of components to remove - - - - - Same with {@link #slice(int, int)} except that this method returns a list. - - - - - Return the current number of {@link IByteBuffer}'s that are composed in this instance - - - - - Return the max number of {@link IByteBuffer}'s that are composed in this instance - - - - - Return the index for the given offset - - - - - Return the {@link IByteBuffer} on the specified index - @param cIndex the index for which the {@link IByteBuffer} should be returned - @return buffer the {@link IByteBuffer} on the specified index - - - - - Return the {@link IByteBuffer} on the specified index - @param offset the offset for which the {@link IByteBuffer} should be returned - @return the {@link IByteBuffer} on the specified index - - - - - Return the internal {@link IByteBuffer} on the specified index. Note that updating the indexes of the returned - buffer will lead to an undefined behavior of this buffer. - @param cIndex the index for which the {@link IByteBuffer} should be returned - - - - - Return the internal {@link IByteBuffer} on the specified offset. Note that updating the indexes of the returned - buffer will lead to an undefined behavior of this buffer. - @param offset the offset for which the {@link IByteBuffer} should be returned - - - - - Consolidate the composed {@link IByteBuffer}s - - - - - Consolidate the composed {@link IByteBuffer}s - @param cIndex the index on which to start to compose - @param numComponents the number of components to compose - - - - - Discard all {@link IByteBuffer}s which are read. - - - - - - Represents an empty byte buffer - - - - - Inspired by the Netty ByteBuffer implementation - (https://github.com/netty/netty/blob/master/buffer/src/main/java/io/netty/buffer/ByteBuf.java) - Provides circular-buffer-esque security around a byte array, allowing reads and writes to occur independently. - In general, the guarantees: - /// LESS THAN OR EQUAL TO LESS THAN OR EQUAL TO - . - - - - - Expands the capacity of this buffer so long as it is less than . - - - - - The allocator who created this buffer - - - - - Sets the of this buffer - - thrown if exceeds the length of the buffer - - - - Sets the of this buffer - - - thrown if is greater than - or less than 0. - - - - - Sets both indexes - - - thrown if or exceeds - the length of the buffer - - - - - Returns true if - is greater than 0. - - - - - Is the buffer readable if and only if the buffer contains equal or more than the specified number of elements - - The number of elements we would like to read - - - - Returns true if and only if - is greater than zero. - - - - - Returns true if and only if the buffer has enough to accomodate - additional bytes. - - The number of additional elements we would like to write. - - - - Sets the and to 0. Does not erase any of the data - written into the buffer already, - but it will overwrite that data. - - - - - Marks the current in this buffer. You can reposition the current - - to the marked by calling . - The initial value of the marked is 0. - - - - - Repositions the current to the marked in this buffer. - - - is thrown if the current is less than the - marked - - - - - Marks the current in this buffer. You can reposition the current - - to the marked by calling . - The initial value of the marked is 0. - - - - - Repositions the current to the marked in this buffer. - - - is thrown if the current is greater than the - marked - - - - - Discards the bytes between the 0th index and . - It moves the bytes between and to the 0th index, - and sets and to 0 and - oldWriterIndex - oldReaderIndex respectively. - - - - - Similar to except that this method might discard - some, all, or none of read bytes depending on its internal implementation to reduce - overall memory bandwidth consumption at the cost of potentially additional memory - consumption. - - - - - Makes sure the number of is equal to or greater than - the specified value (.) If there is enough writable bytes in this buffer, - the method returns with no side effect. Otherwise, it raises an . - - The expected number of minimum writable bytes - - if + > - . - - - - - Tries to make sure the number of - is equal to or greater than the specified value. Unlike , - this method does not raise an exception but returns a code. - - the expected minimum number of writable bytes - - When + minWritableBytes > : -
    -
  • true - the capacity of the buffer is expanded to
  • -
  • false - the capacity of the buffer is unchanged
  • -
- - - 0 if the buffer has enough writable bytes, and its capacity is unchanged. - 1 if the buffer does not have enough bytes, and its capacity is unchanged. - 2 if the buffer has enough writable bytes, and its capacity has been increased. - 3 if the buffer does not have enough bytes, but its capacity has been increased to its maximum. - -
- - - Gets a boolean at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Gets a byte at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Gets a short at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Gets a short at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Gets an ushort at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Gets an ushort at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Gets an integer at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Gets an integer at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Gets an unsigned integer at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Gets an unsigned integer at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Gets a long integer at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Gets a long integer at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Gets a 24-bit medium integer at the specified absolute index in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 3 greater than - - - - - Gets a 24-bit medium integer at the specified absolute index in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 3 greater than - - - - - Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 3 greater than - - - - - Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 3 greater than - - - - - Gets a char at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Gets a float at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Gets a float at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Gets a double at the specified absolute in this buffer. - This method does not modify or - of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Gets a double at the specified absolute in this buffer - in Little Endian Byte Order. This method does not modify - or of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Transfers this buffers data to the specified buffer starting at the specified - absolute until the destination becomes non-writable. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Transfers this buffers data to the specified buffer starting at the specified - absolute until the destination becomes non-writable. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Transfers this buffers data to the specified buffer starting at the specified - absolute until the destination becomes non-writable. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Transfers this buffers data to the specified buffer starting at the specified - absolute until the destination becomes non-writable. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Transfers this buffers data to the specified buffer starting at the specified - absolute until the destination becomes non-writable. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Transfers this buffer's data to the specified stream starting at the - specified absolute index. - - - This method does not modify readerIndex or writerIndex of - this buffer. - - absolute index in this buffer to start getting bytes from - destination stream - the number of bytes to transfer - - if the specified index is less than 0 or - if index + length is greater than - this.capacity - - - - - Gets a string with the given length at the given index. - - - length the length to read - charset that should be use - the string value. - - if length is greater than readable bytes. - - - - - Sets the specified boolean at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Sets the specified byte at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 1 greater than - - - - - Sets the specified short at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Sets the specified short at the specified absolute in this buffer - in the Little Endian Byte Order. This method does not directly modify - or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Sets the specified unsigned short at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Sets the specified unsigned short at the specified absolute in this buffer - in the Little Endian Byte Order. This method does not directly modify - or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Sets the specified integer at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Sets the specified integer at the specified absolute in this buffer - in the Little Endian Byte Order. This method does not directly modify - or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Sets the specified unsigned integer at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Sets the specified unsigned integer at the specified absolute in this buffer - in the Little Endian Byte Order. This method does not directly modify or - of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Sets the specified 24-bit medium integer at the specified absolute in this buffer. - Note that the most significant byte is ignored in the specified value. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 3 greater than - - - - - Sets the specified 24-bit medium integer at the specified absolute in this buffer. - Note that the most significant byte is ignored in the specified value. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 3 greater than - - - - - Sets the specified long integer at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Sets the specified long integer at the specified absolute in this buffer - in the Little Endian Byte Order. This method does not directly modify or - of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Sets the specified UTF-16 char at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 2 greater than - - - - - Sets the specified double at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 8 greater than - - - - - Sets the specified float at the specified absolute in this buffer. - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Sets the specified float at the specified absolute in this buffer - in Little Endian Byte Order. This method does not directly modify - or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Sets the specified float at the specified absolute in this buffer - in Little Endian Byte Order. This method does not directly modify - or of this buffer. - - - if the specified is less than 0 or - index + 4 greater than - - - - - Transfers the byte buffer's contents starting at the specified absolute . - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - + .ReadableBytes greater than - - - - - Transfers the byte buffer's contents starting at the specified absolute . - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - is less than 0 or - + greater than - - - - - Transfers the byte buffer's contents starting at the specified absolute . - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - is less than 0 or - is less than 0 or - + greater than or - + greater than .Capacity - - - - - Transfers the byte buffer's contents starting at the specified absolute . - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - + .Length greater than - - - - - Transfers the byte buffer's contents starting at the specified absolute . - This method does not directly modify or of this buffer. - - - if the specified is less than 0 or - is less than 0 or - is less than 0 or - + greater than or - + greater than .Length - - - - - Transfers the content of the specified source stream to this buffer - starting at the specified absolute . - This method does not modify or of - this buffer. - - absolute index in this byte buffer to start writing to - - number of bytes to transfer - cancellation token - the actual number of bytes read in from the specified channel. - - if the specified index is less than 0 or - if index + length is greater than this.capacity - - - - - Fills this buffer with NULL (0x00) starting at the specified - absolute index. This method does not modify reader index - or writer index of this buffer - - absolute index in this byte buffer to start writing to - length the number of NULs to write to the buffer - - if the specified index is less than 0 or if index + length - is greater than capacity. - - - - - Writes the specified string at the current writer index and increases - the writer index by the written bytes. - - Index on which the string should be written - The string value. - Encoding that should be used. - The written number of bytes. - - if writable bytes is not large enough to write the whole string. - - - - - Gets a boolean at the current and increases the - by 1 in this buffer. - - if is less than 1 - - - - Gets a byte at the current and increases the - by 1 in this buffer. - - if is less than 1 - - - - Gets a short at the current and increases the - by 2 in this buffer. - - if is less than 2 - - - - Gets a short at the current in the Little Endian Byte Order and increases - the by 2 in this buffer. - - if is less than 2 - - - - Gets a 24-bit medium integer at the current and increases the - by 3 in this buffer. - - if is less than 3 - - - - Gets a 24-bit medium integer at the current in the Little Endian Byte Order and - increases the by 3 in this buffer. - - if is less than 3 - - - - Gets an unsigned 24-bit medium integer at the current and increases the - by 3 in this buffer. - - if is less than 3 - - - - Gets an unsigned 24-bit medium integer at the current in the Little Endian Byte Order - and increases the by 3 in this buffer. - - if is less than 3 - - - - Gets an unsigned short at the current and increases the - by 2 in this buffer. - - if is less than 2 - - - - Gets an unsigned short at the current in the Little Endian Byte Order and - increases the by 2 in this buffer. - - if is less than 2 - - - - Gets an integer at the current and increases the - by 4 in this buffer. - - if is less than 4 - - - - Gets an integer at the current in the Little Endian Byte Order and increases - the by 4 in this buffer. - - if is less than 4 - - - - Gets an unsigned integer at the current and increases the - by 4 in this buffer. - - if is less than 4 - - - - Gets an unsigned integer at the current in the Little Endian Byte Order and - increases the by 4 in this buffer. - - if is less than 4 - - - - Gets an long at the current and increases the - by 8 in this buffer. - - if is less than 4 - - - - Gets an long at the current in the Little Endian Byte Order and - increases the by 8 in this buffer. - - if is less than 4 - - - - Gets a 2-byte UTF-16 character at the current and increases the - - by 2 in this buffer. - - if is less than 2 - - - - Gets an 8-byte Decimaling integer at the current and increases the - - by 8 in this buffer. - - if is less than 8 - - - - Gets an 8-byte Decimaling integer at the current and increases the - by 8 in this buffer in Little Endian Byte Order. - - if is less than 8 - - - - Gets an 4-byte Decimaling integer at the current and increases the - - by 4 in this buffer. - - if is less than 4 - - - - Gets an 4-byte Decimaling integer at the current and increases the - by 4 in this buffer in Little Endian Byte Order. - - if is less than 4 - - - - Reads bytes from this buffer into a new destination buffer. - - - if is less than - - - - - Transfers bytes from this buffer's data into the specified destination buffer - starting at the current until the destination becomes - non-writable and increases the by the number of transferred bytes. - - - if destination. is greater than - . - - - - - Gets a string with the given length at the current reader index - and increases the reader index by the given length. - - The length to read - Encoding that should be used - The string value - - - - Increases the current by the specified in this buffer. - - if is greater than . - - - - Returns the maximum of that this buffer holds. Note that - - or might return a less number of s of - . - - - -1 if this buffer cannot represent its content as of . - the number of the underlying s if this buffer has at least one underlying segment. - Note that this method does not return 0 to avoid confusion. - - - - - - - - - Exposes this buffer's readable bytes as an of . Returned segment - shares the content with this buffer. This method is identical - to buf.GetIoBuffer(buf.ReaderIndex, buf.ReadableBytes). This method does not - modify or of this buffer. Please note that the - returned segment will not see the changes of this buffer if this buffer is a dynamic - buffer and it adjusted its capacity. - - - if this buffer cannot represent its content as - of - - - - - - - - Exposes this buffer's sub-region as an of . Returned segment - shares the content with this buffer. This method does not - modify or of this buffer. Please note that the - returned segment will not see the changes of this buffer if this buffer is a dynamic - buffer and it adjusted its capacity. - - - if this buffer cannot represent its content as - of - - - - - - - - Exposes this buffer's readable bytes as an array of of . Returned - segments - share the content with this buffer. This method does not - modify or of this buffer. Please note that - returned segments will not see the changes of this buffer if this buffer is a dynamic - buffer and it adjusted its capacity. - - - if this buffer cannot represent its content with - of - - - - - - - - Exposes this buffer's bytes as an array of of for the specified - index and length. - Returned segments share the content with this buffer. This method does - not modify or of this buffer. Please note that - returned segments will not see the changes of this buffer if this buffer is a dynamic - buffer and it adjusted its capacity. - - - if this buffer cannot represent its content with - of - - - - - - - - Flag that indicates if this is backed by a byte array or not - - - - - Grabs the underlying byte array for this buffer - - - - - Returns {@code true} if and only if this buffer has a reference to the low-level memory address that points - to the backing data. - - - - - Returns the low-level memory address that point to the first byte of ths backing data. - - The low-level memory address - - - - Returns the pointer address of the buffer if the memory is pinned. - - IntPtr.Zero if not pinned. - - - - Creates a deep clone of the existing byte array and returns it - - - - - Unwraps a nested buffer - - - - - Returns a copy of this buffer's readable bytes. Modifying the content of the - returned buffer or this buffer does not affect each other at all.This method is - identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}. - This method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. - - - - - Iterates over the readable bytes of this buffer with the specified processor in ascending order. - - - -1 if the processor iterated to or beyond the end of the readable bytes. - The last-visited index If the returned false. - - Processor. - - - - Iterates over the specified area of this buffer with the specified in ascending order. - (i.e. , (index + 1), .. (index + length - 1)) - - - -1 if the processor iterated to or beyond the end of the specified area. - The last-visited index If the returned false. - - Index. - Length. - Processor. - - - - Iterates over the readable bytes of this buffer with the specified in descending order. - - - -1 if the processor iterated to or beyond the beginning of the readable bytes. - The last-visited index If the returned false. - - Processor. - - - - Iterates over the specified area of this buffer with the specified in descending order. - (i.e. (index + length - 1), (index + length - 2), ... ) - - - -1 if the processor iterated to or beyond the beginning of the specified area. - The last-visited index If the returned false. - - Index. - Length. - Processor. - - - - Thread-safe interface for allocating /. - - - - - Returns the number of bytes of heap memory used by a {@link ByteBufAllocator} or {@code -1} if unknown. - - - - - Returns the number of bytes of direct memory used by a {@link ByteBufAllocator} or {@code -1} if unknown. - - - - - Returns a for a - - - - - Return the data which is held by this {@link ByteBufHolder}. - - - - - Create a deep copy of this {@link ByteBufHolder}. - - - - - Duplicate the {@link ByteBufHolder}. Be aware that this will not automatically call {@link #retain()}. - - - - - Duplicates this {@link ByteBufHolder}. This method returns a retained duplicate unlike {@link #duplicate()}. - - - - - Returns a new {@link ByteBufHolder} which contains the specified {@code content}. - - - - Returns the number of thread caches backed by this arena. - - - Returns the number of tiny sub-pages for the arena. - - - Returns the number of small sub-pages for the arena. - - - Returns the number of chunk lists for the arena. - - - Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for tiny sub-pages. - - - Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for small sub-pages. - - - Returns an unmodifiable {@link List} which holds {@link PoolChunkListMetric}s. - - - Return the number of allocations done via the arena. This includes all sizes. - - - Return the number of tiny allocations done via the arena. - - - Return the number of small allocations done via the arena. - - - Return the number of normal allocations done via the arena. - - - Return the number of huge allocations done via the arena. - - - Return the number of deallocations done via the arena. This includes all sizes. - - - Return the number of tiny deallocations done via the arena. - - - Return the number of small deallocations done via the arena. - - - Return the number of normal deallocations done via the arena. - - - Return the number of huge deallocations done via the arena. - - - Return the number of currently active allocations. - - - Return the number of currently active tiny allocations. - - - Return the number of currently active small allocations. - - - Return the number of currently active normal allocations. - - - Return the number of currently active huge allocations. - - - Return the number of active bytes that are currently allocated by the arena. - - - Return the minimum usage of the chunk list before which chunks are promoted to the previous list. - - - Return the maximum usage of the chunk list after which chunks are promoted to the next list. - - - Return the percentage of the current usage of the chunk. - - - Return the size of the chunk in bytes, this is the maximum of bytes that can be served out of the chunk. - - - Return the number of free bytes in the chunk. - - - Return the number of maximal elements that can be allocated out of the sub-page. - - - Return the number of available elements to be allocated. - - - Return the size (in bytes) of the elements that will be allocated. - - - Return the size (in bytes) of this page. - - - - Description of algorithm for PageRun/PoolSubpage allocation from PoolChunk - Notation: The following terms are important to understand the code - > page - a page is the smallest unit of memory chunk that can be allocated - > chunk - a chunk is a collection of pages - > in this code chunkSize = 2^{maxOrder} /// pageSize - To begin we allocate a byte array of size = chunkSize - Whenever a ByteBuf of given size needs to be created we search for the first position - in the byte array that has enough empty space to accommodate the requested size and - return a (long) handle that encodes this offset information, (this memory segment is then - marked as reserved so it is always used by exactly one ByteBuf and no more) - For simplicity all sizes are normalized according to PoolArena#normalizeCapacity method - This ensures that when we request for memory segments of size >= pageSize the normalizedCapacity - equals the next nearest power of 2 - To search for the first offset in chunk that has at least requested size available we construct a - complete balanced binary tree and store it in an array (just like heaps) - memoryMap - The tree looks like this (the size of each node being mentioned in the parenthesis) - depth=0 1 node (chunkSize) - depth=1 2 nodes (chunkSize/2) - .. - .. - depth=d 2^d nodes (chunkSize/2^d) - .. - depth=maxOrder 2^maxOrder nodes (chunkSize/2^{maxOrder} = pageSize) - depth=maxOrder is the last level and the leafs consist of pages - With this tree available searching in chunkArray translates like this: - To allocate a memory segment of size chunkSize/2^k we search for the first node (from left) at height k - which is unused - Algorithm: - ---------- - Encode the tree in memoryMap with the notation - memoryMap[id] = x => in the subtree rooted at id, the first node that is free to be allocated - is at depth x (counted from depth=0) i.e., at depths [depth_of_id, x), there is no node that is free - As we allocate and free nodes, we update values stored in memoryMap so that the property is maintained - Initialization - - In the beginning we construct the memoryMap array by storing the depth of a node at each node - i.e., memoryMap[id] = depth_of_id - Observations: - ------------- - 1) memoryMap[id] = depth_of_id => it is free / unallocated - 2) memoryMap[id] > depth_of_id => at least one of its child nodes is allocated, so we cannot allocate it, but - some of its children can still be allocated based on their availability - 3) memoryMap[id] = maxOrder + 1 => the node is fully allocated and thus none of its children can be allocated, it - is thus marked as unusable - Algorithm: [allocateNode(d) => we want to find the first node (from left) at height h that can be allocated] - ---------- - 1) start at root (i.e., depth = 0 or id = 1) - 2) if memoryMap[1] > d => cannot be allocated from this chunk - 3) if left node value <= h; we can allocate from left subtree so move to left and repeat until found - 4) else try in right subtree - Algorithm: [allocateRun(size)] - ---------- - 1) Compute d = log_2(chunkSize/size) - 2) Return allocateNode(d) - Algorithm: [allocateSubpage(size)] - ---------- - 1) use allocateNode(maxOrder) to find an empty (i.e., unused) leaf (i.e., page) - 2) use this handle to construct the PoolSubpage object or if it already exists just call init(normCapacity) - note that this PoolSubpage object is added to subpagesPool in the PoolArena when we init() it - Note: - ----- - In the implementation for improving cache coherence, - we store 2 pieces of information (i.e, 2 byte vals) as a short value in memoryMap - memoryMap[id]= (depth_of_id, x) - where as per convention defined above - the second value (i.e, x) indicates that the first node which is free to be allocated is at depth x (from root) - - - - Used to determine if the requested capacity is equal to or greater than pageSize. - - - Used to mark memory as unusable - - - Creates a special chunk that is not pooled. - - - Update method used by allocate - This is triggered only when a successor is allocated and all its predecessors - need to update their state - The minimal depth at which subtree rooted at id has some free space - - @param id id - - - Update method used by free - This needs to handle the special case when both children are completely free - in which case parent be directly allocated on request of size = child-size * 2 - - @param id id - - - Algorithm to allocate an index in memoryMap when we query for a free node - at depth d - - @param d depth - @return index in memoryMap - - - Allocate a run of pages (>=1) - - @param normCapacity normalized capacity - @return index in memoryMap - - - Create/ initialize a new PoolSubpage of normCapacity - Any PoolSubpage created/ initialized here is added to subpage pool in the PoolArena that owns this PoolChunk - - @param normCapacity normalized capacity - @return index in memoryMap - - - Free a subpage or a run of pages - When a subpage is freed from PoolSubpage, it might be added back to subpage pool of the owning PoolArena - If the subpage pool in PoolArena has at least one other PoolSubpage of given elemSize, we can - completely free the owning Page so it is available for subsequent allocations - - @param handle handle to free - - - represents the size in #bytes supported by node 'id' in the tree - - - Calculates the maximum capacity of a buffer that will ever be possible to allocate out of the {@link PoolChunk}s - that belong to the {@link PoolChunkList} with the given {@code minUsage} and {@code maxUsage} settings. - - - Moves the {@link PoolChunk} down the {@link PoolChunkList} linked-list so it will end up in the right - {@link PoolChunkList} that has the correct minUsage / maxUsage in respect to {@link PoolChunk#usage()}. - - - Adds the {@link PoolChunk} to this {@link PoolChunkList}. - - - Method must be called before reuse this {@link PooledByteBufAllocator} - - - Returns the status of the allocator (which contains all metrics) as string. Be aware this may be expensive - and so should not called too frequently. - - - Special constructor that creates a linked list head - - - Returns the bitmap index of the subpage allocation. - - - @return {@code true} if this subpage is in use. - {@code false} if this subpage is not used by its chunk and thus it's OK to be released. - - - - Acts a Thread cache for allocations. This implementation is moduled after - jemalloc and the descripted - technics of - - Scalable - memory allocation using jemalloc - - . - - - - Try to allocate a tiny buffer out of the cache. Returns {@code true} if successful {@code false} otherwise - - - Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise - - - Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise - - - Add {@link PoolChunk} and {@code handle} to the cache if there is enough room. - Returns {@code true} if it fit into the cache {@code false} otherwise. - - - Should be called if the Thread that uses this cache is about to exist to release resources out of the cache - - - Cache used for buffers which are backed by TINY or SMALL size. - - - Cache used for buffers which are backed by NORMAL size. - - - Init the {@link PooledByteBuffer} using the provided chunk and handle with the capacity restrictions. - - - Add to cache if not already full. - - - Allocate something out of the cache if possible and remove the entry from the cache. - - - Clear out this cache and free up all previous cached {@link PoolChunk}s and {@code handle}s. - - - Free up cached {@link PoolChunk}s if not allocated frequently enough. - - - - Utility class for managing and creating unpooled buffers - - - - - Creates a new big-endian buffer which wraps the specified array. - A modification on the specified array's content will be visible to the returned buffer. - - - - - Creates a new big-endian buffer which wraps the sub-region of the - specified array. A modification on the specified array's content - will be visible to the returned buffer. - - - - - Creates a new buffer which wraps the specified buffer's readable bytes. - A modification on the specified buffer's content will be visible to the returned buffer. - - The buffer to wrap. Reference count ownership of this variable is transfered to this method. - The readable portion of the buffer, or an empty buffer if there is no readable portion. - - - - Creates a new big-endian composite buffer which wraps the specified arrays without copying them. - A modification on the specified arrays' content will be visible to the returned buffer. - - - - - Creates a new big-endian composite buffer which wraps the readable bytes of the specified buffers without copying them. - A modification on the content of the specified buffers will be visible to the returned buffer. - - The buffers to wrap. Reference count ownership of all variables is transfered to this method. - The readable portion of the buffers. The caller is responsible for releasing this buffer. - - - - Creates a new big-endian composite buffer which wraps the specified arrays without copying them. - A modification on the specified arrays' content will be visible to the returned buffer. - - - - - Creates a new big-endian composite buffer which wraps the readable bytes of the specified buffers without copying them. - A modification on the content of the specified buffers will be visible to the returned buffer. - - Advisement as to how many independent buffers are allowed to exist before consolidation occurs. - The buffers to wrap. Reference count ownership of all variables is transfered to this method. - The readable portion of the buffers. The caller is responsible for releasing this buffer. - - - - Creates a new big-endian buffer whose content is a copy of the specified array - The new buffer's and - are 0 and respectively. - - A buffer we're going to copy. - The new buffer that copies the contents of array. - - - - Creates a new big-endian buffer whose content is a copy of the specified array. - The new buffer's and - are 0 and respectively. - - A buffer we're going to copy. - The index offset from which we're going to read array. - - The number of bytes we're going to read from array beginning from position offset. - - The new buffer that copies the contents of array. - - - - Creates a new big-endian buffer whose content is a copy of the specified . - The new buffer's and - are 0 and respectively. - - A buffer we're going to copy. - The new buffer that copies the contents of buffer. - - - - Creates a new big-endian buffer whose content is a merged copy of of the specified arrays. - The new buffer's and - are 0 and respectively. - - - - - - - Creates a new big-endian buffer whose content is a merged copy of the specified . - The new buffer's and - are 0 and respectively. - - Buffers we're going to copy. - The new buffer that copies the contents of buffers. - - - - Creates a new 4-byte big-endian buffer that holds the specified 32-bit integer. - - - - - Create a big-endian buffer that holds a sequence of the specified 32-bit integers. - - - - - Creates a new 2-byte big-endian buffer that holds the specified 16-bit integer. - - - - - Create a new big-endian buffer that holds a sequence of the specified 16-bit integers. - - - - - Create a new big-endian buffer that holds a sequence of the specified 16-bit integers. - - - - - Creates a new 3-byte big-endian buffer that holds the specified 24-bit integer. - - - - - Create a new big-endian buffer that holds a sequence of the specified 24-bit integers. - - - - - Creates a new 8-byte big-endian buffer that holds the specified 64-bit integer. - - - - - Create a new big-endian buffer that holds a sequence of the specified 64-bit integers. - - - - - Creates a new single-byte big-endian buffer that holds the specified boolean value. - - - - - Create a new big-endian buffer that holds a sequence of the specified boolean values. - - - - - Creates a new 4-byte big-endian buffer that holds the specified 32-bit floating point number. - - - - - Create a new big-endian buffer that holds a sequence of the specified 32-bit floating point numbers. - - - - - Creates a new 8-byte big-endian buffer that holds the specified 64-bit floating point number. - - - - - Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers. - - - - - Return a unreleasable view on the given {@link ByteBuf} which will just ignore release and retain calls. - - - - - Unpooled implementation of . - - - - Wraps another . - - It's important that the {@link #readerIndex()} and {@link #writerIndex()} will not do any adjustments on the - indices on the fly because of internal optimizations made by {@link ByteBufUtil#writeAscii(ByteBuf, CharSequence)} - and {@link ByteBufUtil#writeUtf8(ByteBuf, CharSequence)}. - -
-
+ + + + DotNetty.Buffers + + + + + + Abstract base class implementation of a + + + + + + Abstract base class for instances + + + + + + Abstract base class for implementations that wrap another + . + + + + + Returns a hex dump + of the specified buffer's sub-region. + + + + + Returns a hex dump + of the specified buffer's sub-region. + + + + + Returns a hex dump + of the specified buffer's sub-region. + + + + + Returns a hex dump + of the specified buffer's sub-region. + + + + + Calculates the hash code of the specified buffer. This method is + useful when implementing a new buffer type. + + + + + Returns the reader index of needle in haystack, or -1 if needle is not in haystack. + + + + + Returns {@code true} if and only if the two specified buffers are + identical to each other for {@code length} bytes starting at {@code aStartIndex} + index for the {@code a} buffer and {@code bStartIndex} index for the {@code b} buffer. + A more compact way to express this is: +

+ {@code a[aStartIndex : aStartIndex + length] == b[bStartIndex : bStartIndex + length]} +

+
+ + + Returns {@code true} if and only if the two specified buffers are + identical to each other as described in {@link ByteBuf#equals(Object)}. + This method is useful when implementing a new buffer type. + + + + + Compares the two specified buffers as described in {@link ByteBuf#compareTo(ByteBuf)}. + This method is useful when implementing a new buffer type. + + + + + The default implementation of . + This method is useful when implementing a new buffer type. + + + + + Read the given amount of bytes into a new {@link ByteBuf} that is allocated from the {@link ByteBufAllocator}. + + + + + Encode a string in http://en.wikipedia.org/wiki/UTF-8 and write it into reserveBytes of + a byte buffer. The reserveBytes must be computed (ie eagerly using {@link #utf8MaxBytes(string)} + or exactly with #utf8Bytes(string)}) to ensure this method not to not: for performance reasons + the index checks will be performed using just reserveBytes. + + This method returns the actual number of bytes written. + + + + Encode the given using the given into a new + which + is allocated via the . + + The to allocate {@link IByteBuffer}. + src The to encode. + charset The specified + + + + Encode the given using the given into a new + which + is allocated via the . + + The to allocate {@link IByteBuffer}. + src The to encode. + charset The specified + the extra capacity to alloc except the space for decoding. + + + + Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans. + + + + + Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans, + starting at the given {@code offset} using the given {@code length}. + + + + + Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified + {@link StringBuilder} that is easy to read by humans. + + + + + Appends the prettified multi-line hexadecimal dump of the specified {@link ByteBuf} to the specified + {@link StringBuilder} that is easy to read by humans, starting at the given {@code offset} using + the given {@code length}. + + + + + Toggles the endianness of the specified 64-bit long integer. + + + + + Toggles the endianness of the specified 32-bit integer. + + + + + Toggles the endianness of the specified 16-bit integer. + + + + + Default on most Windows systems + + + + + Add the given {@link IByteBuffer}. + Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. + If you need to have it increased you need to handle it by your own. + @param buffer the {@link IByteBuffer} to add + + + + + Add the given {@link IByteBuffer}s. + Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. + If you need to have it increased you need to handle it by your own. + @param buffers the {@link IByteBuffer}s to add + + + + + Add the given {@link IByteBuffer}s. + Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. + If you need to have it increased you need to handle it by your own. + @param buffers the {@link IByteBuffer}s to add + + + + + Add the given {@link IByteBuffer} on the specific index. + Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. + If you need to have it increased you need to handle it by your own. + @param cIndex the index on which the {@link IByteBuffer} will be added + @param buffer the {@link IByteBuffer} to add + + + + + Add the given {@link IByteBuffer}s on the specific index + Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. + If you need to have it increased you need to handle it by your own. + @param cIndex the index on which the {@link IByteBuffer} will be added. + @param buffers the {@link IByteBuffer}s to add + + + + + Add the given {@link ByteBuf}s on the specific index + Be aware that this method does not increase the {@code writerIndex} of the {@link CompositeByteBuffer}. + If you need to have it increased you need to handle it by your own. + @param cIndex the index on which the {@link IByteBuffer} will be added. + @param buffers the {@link IByteBuffer}s to add + + + + + This should only be called as last operation from a method as this may adjust the underlying + array of components and so affect the index etc. + + + + + Remove the {@link IByteBuffer} from the given index. + @param cIndex the index on from which the {@link IByteBuffer} will be remove + + + + + Remove the number of {@link IByteBuffer}s starting from the given index. + @param cIndex the index on which the {@link IByteBuffer}s will be started to removed + @param numComponents the number of components to remove + + + + + Same with {@link #slice(int, int)} except that this method returns a list. + + + + + Return the current number of {@link IByteBuffer}'s that are composed in this instance + + + + + Return the max number of {@link IByteBuffer}'s that are composed in this instance + + + + + Return the index for the given offset + + + + + Return the {@link IByteBuffer} on the specified index + @param cIndex the index for which the {@link IByteBuffer} should be returned + @return buffer the {@link IByteBuffer} on the specified index + + + + + Return the {@link IByteBuffer} on the specified index + @param offset the offset for which the {@link IByteBuffer} should be returned + @return the {@link IByteBuffer} on the specified index + + + + + Return the internal {@link IByteBuffer} on the specified index. Note that updating the indexes of the returned + buffer will lead to an undefined behavior of this buffer. + @param cIndex the index for which the {@link IByteBuffer} should be returned + + + + + Return the internal {@link IByteBuffer} on the specified offset. Note that updating the indexes of the returned + buffer will lead to an undefined behavior of this buffer. + @param offset the offset for which the {@link IByteBuffer} should be returned + + + + + Consolidate the composed {@link IByteBuffer}s + + + + + Consolidate the composed {@link IByteBuffer}s + @param cIndex the index on which to start to compose + @param numComponents the number of components to compose + + + + + Discard all {@link IByteBuffer}s which are read. + + + + + + Represents an empty byte buffer + + + + + Inspired by the Netty ByteBuffer implementation + (https://github.com/netty/netty/blob/master/buffer/src/main/java/io/netty/buffer/ByteBuf.java) + Provides circular-buffer-esque security around a byte array, allowing reads and writes to occur independently. + In general, the guarantees: + /// LESS THAN OR EQUAL TO LESS THAN OR EQUAL TO + . + + + + + Expands the capacity of this buffer so long as it is less than . + + + + + The allocator who created this buffer + + + + + Sets the of this buffer + + thrown if exceeds the length of the buffer + + + + Sets the of this buffer + + + thrown if is greater than + or less than 0. + + + + + Sets both indexes + + + thrown if or exceeds + the length of the buffer + + + + + Returns true if - is greater than 0. + + + + + Is the buffer readable if and only if the buffer contains equal or more than the specified number of elements + + The number of elements we would like to read + + + + Returns true if and only if - is greater than zero. + + + + + Returns true if and only if the buffer has enough to accomodate + additional bytes. + + The number of additional elements we would like to write. + + + + Sets the and to 0. Does not erase any of the data + written into the buffer already, + but it will overwrite that data. + + + + + Marks the current in this buffer. You can reposition the current + + to the marked by calling . + The initial value of the marked is 0. + + + + + Repositions the current to the marked in this buffer. + + + is thrown if the current is less than the + marked + + + + + Marks the current in this buffer. You can reposition the current + + to the marked by calling . + The initial value of the marked is 0. + + + + + Repositions the current to the marked in this buffer. + + + is thrown if the current is greater than the + marked + + + + + Discards the bytes between the 0th index and . + It moves the bytes between and to the 0th index, + and sets and to 0 and + oldWriterIndex - oldReaderIndex respectively. + + + + + Similar to except that this method might discard + some, all, or none of read bytes depending on its internal implementation to reduce + overall memory bandwidth consumption at the cost of potentially additional memory + consumption. + + + + + Makes sure the number of is equal to or greater than + the specified value (.) If there is enough writable bytes in this buffer, + the method returns with no side effect. Otherwise, it raises an . + + The expected number of minimum writable bytes + + if + > + . + + + + + Tries to make sure the number of + is equal to or greater than the specified value. Unlike , + this method does not raise an exception but returns a code. + + the expected minimum number of writable bytes + + When + minWritableBytes > : +
    +
  • true - the capacity of the buffer is expanded to
  • +
  • false - the capacity of the buffer is unchanged
  • +
+ + + 0 if the buffer has enough writable bytes, and its capacity is unchanged. + 1 if the buffer does not have enough bytes, and its capacity is unchanged. + 2 if the buffer has enough writable bytes, and its capacity has been increased. + 3 if the buffer does not have enough bytes, but its capacity has been increased to its maximum. + +
+ + + Gets a boolean at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Gets a byte at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Gets a short at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Gets a short at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Gets an ushort at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Gets an ushort at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Gets an integer at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Gets an integer at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Gets an unsigned integer at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Gets an unsigned integer at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Gets a long integer at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Gets a long integer at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Gets a 24-bit medium integer at the specified absolute index in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 3 greater than + + + + + Gets a 24-bit medium integer at the specified absolute index in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 3 greater than + + + + + Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 3 greater than + + + + + Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 3 greater than + + + + + Gets a char at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Gets a float at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Gets a float at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Gets a double at the specified absolute in this buffer. + This method does not modify or + of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Gets a double at the specified absolute in this buffer + in Little Endian Byte Order. This method does not modify + or of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Transfers this buffers data to the specified buffer starting at the specified + absolute until the destination becomes non-writable. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Transfers this buffers data to the specified buffer starting at the specified + absolute until the destination becomes non-writable. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Transfers this buffers data to the specified buffer starting at the specified + absolute until the destination becomes non-writable. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Transfers this buffers data to the specified buffer starting at the specified + absolute until the destination becomes non-writable. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Transfers this buffers data to the specified buffer starting at the specified + absolute until the destination becomes non-writable. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Transfers this buffer's data to the specified stream starting at the + specified absolute index. + + + This method does not modify readerIndex or writerIndex of + this buffer. + + absolute index in this buffer to start getting bytes from + destination stream + the number of bytes to transfer + + if the specified index is less than 0 or + if index + length is greater than + this.capacity + + + + + Gets a string with the given length at the given index. + + + length the length to read + charset that should be use + the string value. + + if length is greater than readable bytes. + + + + + Sets the specified boolean at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Sets the specified byte at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 1 greater than + + + + + Sets the specified short at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Sets the specified short at the specified absolute in this buffer + in the Little Endian Byte Order. This method does not directly modify + or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Sets the specified unsigned short at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Sets the specified unsigned short at the specified absolute in this buffer + in the Little Endian Byte Order. This method does not directly modify + or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Sets the specified integer at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Sets the specified integer at the specified absolute in this buffer + in the Little Endian Byte Order. This method does not directly modify + or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Sets the specified unsigned integer at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Sets the specified unsigned integer at the specified absolute in this buffer + in the Little Endian Byte Order. This method does not directly modify or + of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Sets the specified 24-bit medium integer at the specified absolute in this buffer. + Note that the most significant byte is ignored in the specified value. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 3 greater than + + + + + Sets the specified 24-bit medium integer at the specified absolute in this buffer. + Note that the most significant byte is ignored in the specified value. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 3 greater than + + + + + Sets the specified long integer at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Sets the specified long integer at the specified absolute in this buffer + in the Little Endian Byte Order. This method does not directly modify or + of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Sets the specified UTF-16 char at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 2 greater than + + + + + Sets the specified double at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 8 greater than + + + + + Sets the specified float at the specified absolute in this buffer. + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Sets the specified float at the specified absolute in this buffer + in Little Endian Byte Order. This method does not directly modify + or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Sets the specified float at the specified absolute in this buffer + in Little Endian Byte Order. This method does not directly modify + or of this buffer. + + + if the specified is less than 0 or + index + 4 greater than + + + + + Transfers the byte buffer's contents starting at the specified absolute . + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + + .ReadableBytes greater than + + + + + Transfers the byte buffer's contents starting at the specified absolute . + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + is less than 0 or + + greater than + + + + + Transfers the byte buffer's contents starting at the specified absolute . + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + is less than 0 or + is less than 0 or + + greater than or + + greater than .Capacity + + + + + Transfers the byte buffer's contents starting at the specified absolute . + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + + .Length greater than + + + + + Transfers the byte buffer's contents starting at the specified absolute . + This method does not directly modify or of this buffer. + + + if the specified is less than 0 or + is less than 0 or + is less than 0 or + + greater than or + + greater than .Length + + + + + Transfers the content of the specified source stream to this buffer + starting at the specified absolute . + This method does not modify or of + this buffer. + + absolute index in this byte buffer to start writing to + + number of bytes to transfer + cancellation token + the actual number of bytes read in from the specified channel. + + if the specified index is less than 0 or + if index + length is greater than this.capacity + + + + + Fills this buffer with NULL (0x00) starting at the specified + absolute index. This method does not modify reader index + or writer index of this buffer + + absolute index in this byte buffer to start writing to + length the number of NULs to write to the buffer + + if the specified index is less than 0 or if index + length + is greater than capacity. + + + + + Writes the specified string at the current writer index and increases + the writer index by the written bytes. + + Index on which the string should be written + The string value. + Encoding that should be used. + The written number of bytes. + + if writable bytes is not large enough to write the whole string. + + + + + Gets a boolean at the current and increases the + by 1 in this buffer. + + if is less than 1 + + + + Gets a byte at the current and increases the + by 1 in this buffer. + + if is less than 1 + + + + Gets a short at the current and increases the + by 2 in this buffer. + + if is less than 2 + + + + Gets a short at the current in the Little Endian Byte Order and increases + the by 2 in this buffer. + + if is less than 2 + + + + Gets a 24-bit medium integer at the current and increases the + by 3 in this buffer. + + if is less than 3 + + + + Gets a 24-bit medium integer at the current in the Little Endian Byte Order and + increases the by 3 in this buffer. + + if is less than 3 + + + + Gets an unsigned 24-bit medium integer at the current and increases the + by 3 in this buffer. + + if is less than 3 + + + + Gets an unsigned 24-bit medium integer at the current in the Little Endian Byte Order + and increases the by 3 in this buffer. + + if is less than 3 + + + + Gets an unsigned short at the current and increases the + by 2 in this buffer. + + if is less than 2 + + + + Gets an unsigned short at the current in the Little Endian Byte Order and + increases the by 2 in this buffer. + + if is less than 2 + + + + Gets an integer at the current and increases the + by 4 in this buffer. + + if is less than 4 + + + + Gets an integer at the current in the Little Endian Byte Order and increases + the by 4 in this buffer. + + if is less than 4 + + + + Gets an unsigned integer at the current and increases the + by 4 in this buffer. + + if is less than 4 + + + + Gets an unsigned integer at the current in the Little Endian Byte Order and + increases the by 4 in this buffer. + + if is less than 4 + + + + Gets an long at the current and increases the + by 8 in this buffer. + + if is less than 4 + + + + Gets an long at the current in the Little Endian Byte Order and + increases the by 8 in this buffer. + + if is less than 4 + + + + Gets a 2-byte UTF-16 character at the current and increases the + + by 2 in this buffer. + + if is less than 2 + + + + Gets an 8-byte Decimaling integer at the current and increases the + + by 8 in this buffer. + + if is less than 8 + + + + Gets an 8-byte Decimaling integer at the current and increases the + by 8 in this buffer in Little Endian Byte Order. + + if is less than 8 + + + + Gets an 4-byte Decimaling integer at the current and increases the + + by 4 in this buffer. + + if is less than 4 + + + + Gets an 4-byte Decimaling integer at the current and increases the + by 4 in this buffer in Little Endian Byte Order. + + if is less than 4 + + + + Reads bytes from this buffer into a new destination buffer. + + + if is less than + + + + + Transfers bytes from this buffer's data into the specified destination buffer + starting at the current until the destination becomes + non-writable and increases the by the number of transferred bytes. + + + if destination. is greater than + . + + + + + Gets a string with the given length at the current reader index + and increases the reader index by the given length. + + The length to read + Encoding that should be used + The string value + + + + Increases the current by the specified in this buffer. + + if is greater than . + + + + Returns the maximum of that this buffer holds. Note that + + or might return a less number of s of + . + + + -1 if this buffer cannot represent its content as of . + the number of the underlying s if this buffer has at least one underlying segment. + Note that this method does not return 0 to avoid confusion. + + + + + + + + + Exposes this buffer's readable bytes as an of . Returned segment + shares the content with this buffer. This method is identical + to buf.GetIoBuffer(buf.ReaderIndex, buf.ReadableBytes). This method does not + modify or of this buffer. Please note that the + returned segment will not see the changes of this buffer if this buffer is a dynamic + buffer and it adjusted its capacity. + + + if this buffer cannot represent its content as + of + + + + + + + + Exposes this buffer's sub-region as an of . Returned segment + shares the content with this buffer. This method does not + modify or of this buffer. Please note that the + returned segment will not see the changes of this buffer if this buffer is a dynamic + buffer and it adjusted its capacity. + + + if this buffer cannot represent its content as + of + + + + + + + + Exposes this buffer's readable bytes as an array of of . Returned + segments + share the content with this buffer. This method does not + modify or of this buffer. Please note that + returned segments will not see the changes of this buffer if this buffer is a dynamic + buffer and it adjusted its capacity. + + + if this buffer cannot represent its content with + of + + + + + + + + Exposes this buffer's bytes as an array of of for the specified + index and length. + Returned segments share the content with this buffer. This method does + not modify or of this buffer. Please note that + returned segments will not see the changes of this buffer if this buffer is a dynamic + buffer and it adjusted its capacity. + + + if this buffer cannot represent its content with + of + + + + + + + + Flag that indicates if this is backed by a byte array or not + + + + + Grabs the underlying byte array for this buffer + + + + + Returns {@code true} if and only if this buffer has a reference to the low-level memory address that points + to the backing data. + + + + + Returns the low-level memory address that point to the first byte of ths backing data. + + The low-level memory address + + + + Returns the pointer address of the buffer if the memory is pinned. + + IntPtr.Zero if not pinned. + + + + Creates a deep clone of the existing byte array and returns it + + + + + Unwraps a nested buffer + + + + + Returns a copy of this buffer's readable bytes. Modifying the content of the + returned buffer or this buffer does not affect each other at all.This method is + identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}. + This method does not modify {@code readerIndex} or {@code writerIndex} of this buffer. + + + + + Iterates over the readable bytes of this buffer with the specified processor in ascending order. + + + -1 if the processor iterated to or beyond the end of the readable bytes. + The last-visited index If the returned false. + + Processor. + + + + Iterates over the specified area of this buffer with the specified in ascending order. + (i.e. , (index + 1), .. (index + length - 1)) + + + -1 if the processor iterated to or beyond the end of the specified area. + The last-visited index If the returned false. + + Index. + Length. + Processor. + + + + Iterates over the readable bytes of this buffer with the specified in descending order. + + + -1 if the processor iterated to or beyond the beginning of the readable bytes. + The last-visited index If the returned false. + + Processor. + + + + Iterates over the specified area of this buffer with the specified in descending order. + (i.e. (index + length - 1), (index + length - 2), ... ) + + + -1 if the processor iterated to or beyond the beginning of the specified area. + The last-visited index If the returned false. + + Index. + Length. + Processor. + + + + Thread-safe interface for allocating /. + + + + + Returns the number of bytes of heap memory used by a {@link ByteBufAllocator} or {@code -1} if unknown. + + + + + Returns the number of bytes of direct memory used by a {@link ByteBufAllocator} or {@code -1} if unknown. + + + + + Returns a for a + + + + + Return the data which is held by this {@link ByteBufHolder}. + + + + + Create a deep copy of this {@link ByteBufHolder}. + + + + + Duplicate the {@link ByteBufHolder}. Be aware that this will not automatically call {@link #retain()}. + + + + + Duplicates this {@link ByteBufHolder}. This method returns a retained duplicate unlike {@link #duplicate()}. + + + + + Returns a new {@link ByteBufHolder} which contains the specified {@code content}. + + + + Returns the number of thread caches backed by this arena. + + + Returns the number of tiny sub-pages for the arena. + + + Returns the number of small sub-pages for the arena. + + + Returns the number of chunk lists for the arena. + + + Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for tiny sub-pages. + + + Returns an unmodifiable {@link List} which holds {@link PoolSubpageMetric}s for small sub-pages. + + + Returns an unmodifiable {@link List} which holds {@link PoolChunkListMetric}s. + + + Return the number of allocations done via the arena. This includes all sizes. + + + Return the number of tiny allocations done via the arena. + + + Return the number of small allocations done via the arena. + + + Return the number of normal allocations done via the arena. + + + Return the number of huge allocations done via the arena. + + + Return the number of deallocations done via the arena. This includes all sizes. + + + Return the number of tiny deallocations done via the arena. + + + Return the number of small deallocations done via the arena. + + + Return the number of normal deallocations done via the arena. + + + Return the number of huge deallocations done via the arena. + + + Return the number of currently active allocations. + + + Return the number of currently active tiny allocations. + + + Return the number of currently active small allocations. + + + Return the number of currently active normal allocations. + + + Return the number of currently active huge allocations. + + + Return the number of active bytes that are currently allocated by the arena. + + + Return the minimum usage of the chunk list before which chunks are promoted to the previous list. + + + Return the maximum usage of the chunk list after which chunks are promoted to the next list. + + + Return the percentage of the current usage of the chunk. + + + Return the size of the chunk in bytes, this is the maximum of bytes that can be served out of the chunk. + + + Return the number of free bytes in the chunk. + + + Return the number of maximal elements that can be allocated out of the sub-page. + + + Return the number of available elements to be allocated. + + + Return the size (in bytes) of the elements that will be allocated. + + + Return the size (in bytes) of this page. + + + + Description of algorithm for PageRun/PoolSubpage allocation from PoolChunk + Notation: The following terms are important to understand the code + > page - a page is the smallest unit of memory chunk that can be allocated + > chunk - a chunk is a collection of pages + > in this code chunkSize = 2^{maxOrder} /// pageSize + To begin we allocate a byte array of size = chunkSize + Whenever a ByteBuf of given size needs to be created we search for the first position + in the byte array that has enough empty space to accommodate the requested size and + return a (long) handle that encodes this offset information, (this memory segment is then + marked as reserved so it is always used by exactly one ByteBuf and no more) + For simplicity all sizes are normalized according to PoolArena#normalizeCapacity method + This ensures that when we request for memory segments of size >= pageSize the normalizedCapacity + equals the next nearest power of 2 + To search for the first offset in chunk that has at least requested size available we construct a + complete balanced binary tree and store it in an array (just like heaps) - memoryMap + The tree looks like this (the size of each node being mentioned in the parenthesis) + depth=0 1 node (chunkSize) + depth=1 2 nodes (chunkSize/2) + .. + .. + depth=d 2^d nodes (chunkSize/2^d) + .. + depth=maxOrder 2^maxOrder nodes (chunkSize/2^{maxOrder} = pageSize) + depth=maxOrder is the last level and the leafs consist of pages + With this tree available searching in chunkArray translates like this: + To allocate a memory segment of size chunkSize/2^k we search for the first node (from left) at height k + which is unused + Algorithm: + ---------- + Encode the tree in memoryMap with the notation + memoryMap[id] = x => in the subtree rooted at id, the first node that is free to be allocated + is at depth x (counted from depth=0) i.e., at depths [depth_of_id, x), there is no node that is free + As we allocate and free nodes, we update values stored in memoryMap so that the property is maintained + Initialization - + In the beginning we construct the memoryMap array by storing the depth of a node at each node + i.e., memoryMap[id] = depth_of_id + Observations: + ------------- + 1) memoryMap[id] = depth_of_id => it is free / unallocated + 2) memoryMap[id] > depth_of_id => at least one of its child nodes is allocated, so we cannot allocate it, but + some of its children can still be allocated based on their availability + 3) memoryMap[id] = maxOrder + 1 => the node is fully allocated and thus none of its children can be allocated, it + is thus marked as unusable + Algorithm: [allocateNode(d) => we want to find the first node (from left) at height h that can be allocated] + ---------- + 1) start at root (i.e., depth = 0 or id = 1) + 2) if memoryMap[1] > d => cannot be allocated from this chunk + 3) if left node value <= h; we can allocate from left subtree so move to left and repeat until found + 4) else try in right subtree + Algorithm: [allocateRun(size)] + ---------- + 1) Compute d = log_2(chunkSize/size) + 2) Return allocateNode(d) + Algorithm: [allocateSubpage(size)] + ---------- + 1) use allocateNode(maxOrder) to find an empty (i.e., unused) leaf (i.e., page) + 2) use this handle to construct the PoolSubpage object or if it already exists just call init(normCapacity) + note that this PoolSubpage object is added to subpagesPool in the PoolArena when we init() it + Note: + ----- + In the implementation for improving cache coherence, + we store 2 pieces of information (i.e, 2 byte vals) as a short value in memoryMap + memoryMap[id]= (depth_of_id, x) + where as per convention defined above + the second value (i.e, x) indicates that the first node which is free to be allocated is at depth x (from root) + + + + Used to determine if the requested capacity is equal to or greater than pageSize. + + + Used to mark memory as unusable + + + Creates a special chunk that is not pooled. + + + Update method used by allocate + This is triggered only when a successor is allocated and all its predecessors + need to update their state + The minimal depth at which subtree rooted at id has some free space + + @param id id + + + Update method used by free + This needs to handle the special case when both children are completely free + in which case parent be directly allocated on request of size = child-size * 2 + + @param id id + + + Algorithm to allocate an index in memoryMap when we query for a free node + at depth d + + @param d depth + @return index in memoryMap + + + Allocate a run of pages (>=1) + + @param normCapacity normalized capacity + @return index in memoryMap + + + Create/ initialize a new PoolSubpage of normCapacity + Any PoolSubpage created/ initialized here is added to subpage pool in the PoolArena that owns this PoolChunk + + @param normCapacity normalized capacity + @return index in memoryMap + + + Free a subpage or a run of pages + When a subpage is freed from PoolSubpage, it might be added back to subpage pool of the owning PoolArena + If the subpage pool in PoolArena has at least one other PoolSubpage of given elemSize, we can + completely free the owning Page so it is available for subsequent allocations + + @param handle handle to free + + + represents the size in #bytes supported by node 'id' in the tree + + + Calculates the maximum capacity of a buffer that will ever be possible to allocate out of the {@link PoolChunk}s + that belong to the {@link PoolChunkList} with the given {@code minUsage} and {@code maxUsage} settings. + + + Moves the {@link PoolChunk} down the {@link PoolChunkList} linked-list so it will end up in the right + {@link PoolChunkList} that has the correct minUsage / maxUsage in respect to {@link PoolChunk#usage()}. + + + Adds the {@link PoolChunk} to this {@link PoolChunkList}. + + + Method must be called before reuse this {@link PooledByteBufAllocator} + + + Returns the status of the allocator (which contains all metrics) as string. Be aware this may be expensive + and so should not called too frequently. + + + Special constructor that creates a linked list head + + + Returns the bitmap index of the subpage allocation. + + + @return {@code true} if this subpage is in use. + {@code false} if this subpage is not used by its chunk and thus it's OK to be released. + + + + Acts a Thread cache for allocations. This implementation is moduled after + jemalloc and the descripted + technics of + + Scalable + memory allocation using jemalloc + + . + + + + Try to allocate a tiny buffer out of the cache. Returns {@code true} if successful {@code false} otherwise + + + Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise + + + Try to allocate a small buffer out of the cache. Returns {@code true} if successful {@code false} otherwise + + + Add {@link PoolChunk} and {@code handle} to the cache if there is enough room. + Returns {@code true} if it fit into the cache {@code false} otherwise. + + + Should be called if the Thread that uses this cache is about to exist to release resources out of the cache + + + Cache used for buffers which are backed by TINY or SMALL size. + + + Cache used for buffers which are backed by NORMAL size. + + + Init the {@link PooledByteBuffer} using the provided chunk and handle with the capacity restrictions. + + + Add to cache if not already full. + + + Allocate something out of the cache if possible and remove the entry from the cache. + + + Clear out this cache and free up all previous cached {@link PoolChunk}s and {@code handle}s. + + + Free up cached {@link PoolChunk}s if not allocated frequently enough. + + + + Utility class for managing and creating unpooled buffers + + + + + Creates a new big-endian buffer which wraps the specified array. + A modification on the specified array's content will be visible to the returned buffer. + + + + + Creates a new big-endian buffer which wraps the sub-region of the + specified array. A modification on the specified array's content + will be visible to the returned buffer. + + + + + Creates a new buffer which wraps the specified buffer's readable bytes. + A modification on the specified buffer's content will be visible to the returned buffer. + + The buffer to wrap. Reference count ownership of this variable is transfered to this method. + The readable portion of the buffer, or an empty buffer if there is no readable portion. + + + + Creates a new big-endian composite buffer which wraps the specified arrays without copying them. + A modification on the specified arrays' content will be visible to the returned buffer. + + + + + Creates a new big-endian composite buffer which wraps the readable bytes of the specified buffers without copying them. + A modification on the content of the specified buffers will be visible to the returned buffer. + + The buffers to wrap. Reference count ownership of all variables is transfered to this method. + The readable portion of the buffers. The caller is responsible for releasing this buffer. + + + + Creates a new big-endian composite buffer which wraps the specified arrays without copying them. + A modification on the specified arrays' content will be visible to the returned buffer. + + + + + Creates a new big-endian composite buffer which wraps the readable bytes of the specified buffers without copying them. + A modification on the content of the specified buffers will be visible to the returned buffer. + + Advisement as to how many independent buffers are allowed to exist before consolidation occurs. + The buffers to wrap. Reference count ownership of all variables is transfered to this method. + The readable portion of the buffers. The caller is responsible for releasing this buffer. + + + + Creates a new big-endian buffer whose content is a copy of the specified array + The new buffer's and + are 0 and respectively. + + A buffer we're going to copy. + The new buffer that copies the contents of array. + + + + Creates a new big-endian buffer whose content is a copy of the specified array. + The new buffer's and + are 0 and respectively. + + A buffer we're going to copy. + The index offset from which we're going to read array. + + The number of bytes we're going to read from array beginning from position offset. + + The new buffer that copies the contents of array. + + + + Creates a new big-endian buffer whose content is a copy of the specified . + The new buffer's and + are 0 and respectively. + + A buffer we're going to copy. + The new buffer that copies the contents of buffer. + + + + Creates a new big-endian buffer whose content is a merged copy of of the specified arrays. + The new buffer's and + are 0 and respectively. + + + + + + + Creates a new big-endian buffer whose content is a merged copy of the specified . + The new buffer's and + are 0 and respectively. + + Buffers we're going to copy. + The new buffer that copies the contents of buffers. + + + + Creates a new 4-byte big-endian buffer that holds the specified 32-bit integer. + + + + + Create a big-endian buffer that holds a sequence of the specified 32-bit integers. + + + + + Creates a new 2-byte big-endian buffer that holds the specified 16-bit integer. + + + + + Create a new big-endian buffer that holds a sequence of the specified 16-bit integers. + + + + + Create a new big-endian buffer that holds a sequence of the specified 16-bit integers. + + + + + Creates a new 3-byte big-endian buffer that holds the specified 24-bit integer. + + + + + Create a new big-endian buffer that holds a sequence of the specified 24-bit integers. + + + + + Creates a new 8-byte big-endian buffer that holds the specified 64-bit integer. + + + + + Create a new big-endian buffer that holds a sequence of the specified 64-bit integers. + + + + + Creates a new single-byte big-endian buffer that holds the specified boolean value. + + + + + Create a new big-endian buffer that holds a sequence of the specified boolean values. + + + + + Creates a new 4-byte big-endian buffer that holds the specified 32-bit floating point number. + + + + + Create a new big-endian buffer that holds a sequence of the specified 32-bit floating point numbers. + + + + + Creates a new 8-byte big-endian buffer that holds the specified 64-bit floating point number. + + + + + Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers. + + + + + Return a unreleasable view on the given {@link ByteBuf} which will just ignore release and retain calls. + + + + + Unpooled implementation of . + + + + Wraps another . + + It's important that the {@link #readerIndex()} and {@link #writerIndex()} will not do any adjustments on the + indices on the fly because of internal optimizations made by {@link ByteBufUtil#writeAscii(ByteBuf, CharSequence)} + and {@link ByteBufUtil#writeUtf8(ByteBuf, CharSequence)}. + +
+
diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml.meta index a87b2b2..4013c5f 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Buffers.xml.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 991956ddfc61ef14ca46d3c8eae721e9 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 991956ddfc61ef14ca46d3c8eae721e9 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.mdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.mdb.meta index f43737e..d661e8e 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.mdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.mdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 70f0a8fa49650a4458ed62e36ce70603 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 70f0a8fa49650a4458ed62e36ce70603 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.meta index 44f0b5e..17e51c1 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: 7fc98c66abee8d2489b521b5379ef98d -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 7fc98c66abee8d2489b521b5379ef98d +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.pdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.pdb.meta index caffe26..7aa93ef 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.pdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.pdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 0ae5a74b089e32d4f9e7f3ffe94e6072 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 0ae5a74b089e32d4f9e7f3ffe94e6072 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml index 2999d6b..8bcbd67 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml @@ -1,646 +1,646 @@ - - - - DotNetty.Codecs - - - - - http://www.faqs.org/rfcs/rfc3548.html - Table 1: The Base 64 Alphabet - - - - - http://www.faqs.org/rfcs/rfc3548.html - Table 2: The "URL and Filename safe" Base 64 Alphabet - - - - - Cumulates instances of by merging them into one , using memory - copies. - - - - - Cumulate instances of by add them to a and therefore - avoiding memory copy when possible. - - - Be aware that use a more complex indexing implementation so depending on your - use-case - and the decoder implementation this may be slower then just use the . - - - - - Determines whether only one message should be decoded per call. - Default is false as this has performance impacts. - - Is particularly useful in support of protocol upgrade scenarios. - - - - Returns the actual number of readable bytes in the internal cumulative - buffer of this decoder. You usually do not need to rely on this value - to write a decoder. Use it only when you must use it at your own risk. - This method is a shortcut to of . - - - - - An which is thrown by a codec. - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Adler32.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/CRC32.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Deflate.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Deflater.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/GZIPException.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/GZIPHeader.java - - http://www.ietf.org/rfc/rfc1952.txt - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/InfBlocks.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/InfCodes.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Inflate.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Inflater.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/InfTree.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/JZlib.java - - - - Creates a new zlib encoder with the specified {@code compressionLevel}, - the specified {@code windowBits}, the specified {@code memLevel}, and - the specified wrapper. - - @param compressionLevel - {@code 1} yields the fastest compression and {@code 9} yields the - best compression. {@code 0} means no compression. The default - compression level is {@code 6}. - @param windowBits - The base two logarithm of the size of the history buffer. The - value should be in the range {@code 9} to {@code 15} inclusive. - Larger values result in better compression at the expense of - memory usage. The default value is {@code 15}. - @param memLevel - How much memory should be allocated for the internal compression - state. {@code 1} uses minimum memory and {@code 9} uses maximum - memory. Larger values result in better and faster compression - at the expense of memory usage. The default value is {@code 8} - - @throws CompressionException if failed to initialize zlib - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/StaticTree.java - - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Tree.java - - - - Close this {@link ZlibEncoder} and so finish the encoding. - - The returned {@link ChannelFuture} will be notified once the - operation completes. - - - The container file formats that wrap the stream compressed by the DEFLATE - algorithm. - - - The ZLIB wrapper as specified in RFC 1950. - - - The GZIP wrapper as specified in RFC 1952. - - - Raw DEFLATE stream only (no header and no footer). - - - Try {@link #ZLIB} first and then {@link #NONE} if the first attempt fails. - Please note that you can specify this wrapper type only when decompressing. - - - - https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/ZStream.java - - - - Those methods are expected to be override by Inflater and Deflater. - In the future, they will become abstract methods. - - - - A which is thrown when the received frame data could not - be decoded by an inbound handler. - - - - - A decoder that splits the received by one or more - delimiters.It is particularly useful for decoding the frames which ends - with a delimiter such as or - -

Specifying more than one delimiter

- allows you to specify more than one - delimiter. If more than one delimiter is found in the buffer, it chooses - the delimiter which produces the shortest frame. For example, if you have - the following data in the buffer: - +--------------+ - | ABC\nDEF\r\n | - +--------------+ - a will choose '\n' as the first delimiter and produce two - frames: - +-----+-----+ - | ABC | DEF | - +-----+-----+ - rather than incorrectly choosing '\r\n' as the first delimiter: - +----------+ - | ABC\nDEF | - +----------+ -
-
- - Common constructor - - The maximum length of the decoded frame - NOTE: A see is thrown if the length of the frame exceeds this - value. - - whether the decoded frame should strip out the delimiter or not - - If true, a is - thrown as soon as the decoder notices the length of the - frame will exceedmaxFrameLength regardless of - whether the entire frame has been read. - If false, a is - thrown after the entire frame that exceeds maxFrameLength has been read. - - delimiters - - - Returns true if the delimiters are "\n" and "\r\n" - - - ReturnsReturn true if the current instance is a subclass of DelimiterBasedFrameDecoder - - - Create a frame out of the and return it - - the which this - belongs to - - the from which to read data - - the which represent the frame or null if no frame could be - created. - - - - Returns the number of bytes between the readerIndex of the haystack and - the first needle found in the haystack. -1 is returned if no needle is - found in the haystack. - - - Returns a null (0x00) delimiter, which could be used for Flash XML socket or any similar protocols - - - - Returns {@code CR ('\r')} and {@code LF ('\n')} delimiters, which could - be used for text-based line protocols. - - - - - Splits a byte stream of JSON objects and arrays into individual objects/arrays and passes them up the - . - This class does not do any real parsing or validation. A sequence of bytes is considered a JSON object/array - if it contains a matching number of opening and closing braces/brackets. It's up to a subsequent - - to parse the JSON text into a more usable form i.e.a POCO. - - - - - - Create a new instance. - - - The maximum length of the frame. If the length of the frame is - greater than this value then will be thrown. - - The offset of the length field. - The length of the length field. - - - - Create a new instance. - - - The maximum length of the frame. If the length of the frame is - greater than this value then will be thrown. - - The offset of the length field. - The length of the length field. - The compensation value to add to the value of the length field. - the number of first bytes to strip out from the decoded frame. - - - - Create a new instance. - - - The maximum length of the frame. If the length of the frame is - greater than this value then will be thrown. - - The offset of the length field. - The length of the length field. - The compensation value to add to the value of the length field. - the number of first bytes to strip out from the decoded frame. - - If true, a is thrown as soon as the decoder notices the length - of the frame will exceeed regardless of whether the entire frame has been - read. If false, a is thrown after the entire frame that exceeds - has been read. - Defaults to true in other overloads. - - - - - Create a new instance. - - The of the lenght field. - - The maximum length of the frame. If the length of the frame is - greater than this value then will be thrown. - - The offset of the length field. - The length of the length field. - The compensation value to add to the value of the length field. - the number of first bytes to strip out from the decoded frame. - - If true, a is thrown as soon as the decoder notices the length - of the frame will exceeed regardless of whether the entire frame has been - read. If false, a is thrown after the entire frame that exceeds - has been read. - Defaults to true in other overloads. - - - - - Create a frame out of the and return it. - - - The which this belongs - to. - - The from which to read data. - The which represents the frame or null if no frame could be created. - - - - Decodes the specified region of the buffer into an unadjusted frame length. The default implementation is - capable of decoding the specified region into an unsigned 8/16/24/32/64 bit integer. Override this method to - decode the length field encoded differently. - Note that this method must not modify the state of the specified buffer (e.g. - , - , and the content of the buffer.) - - The buffer we'll be extracting the frame length from. - The offset from the absolute . - The length of the framelenght field. Expected: 1, 2, 3, 4, or 8. - The preferred of buffer. - A long integer that represents the unadjusted length of the next frame. - - - - An encoder that prepends the length of the message. The length value is - prepended as a binary form. -

- For example, {@link LengthFieldPrepender}(2) will encode the - following 12-bytes string: -

-                    +----------------+
-                    | "HELLO, WORLD" |
-                    +----------------+
-                
- into the following: -
-                    +--------+----------------+
-                    + 0x000C | "HELLO, WORLD" |
-                    +--------+----------------+
-                
- If you turned on the {@code lengthIncludesLengthFieldLength} flag in the - constructor, the encoded data would look like the following - (12 (original data) + 2 (prepended data) = 14 (0xE)): -
-                    +--------+----------------+
-                    + 0x000E | "HELLO, WORLD" |
-                    +--------+----------------+
-                
-
-
- - - Creates a new instance. - - - The length of the prepended length field. - Only 1, 2, 3, 4, and 8 are allowed. - - - - - Creates a new instance. - - - The length of the prepended length field. - Only 1, 2, 3, 4, and 8 are allowed. - - - If true, the length of the prepended length field is added - to the value of the prepended length field. - - - - - Creates a new instance. - - - The length of the prepended length field. - Only 1, 2, 3, 4, and 8 are allowed. - - The compensation value to add to the value of the length field. - - - - Creates a new instance. - - - The length of the prepended length field. - Only 1, 2, 3, 4, and 8 are allowed. - - - If true, the length of the prepended length field is added - to the value of the prepended length field. - - The compensation value to add to the value of the length field. - - - - Creates a new instance. - - The of the length field. - - The length of the prepended length field. - Only 1, 2, 3, 4, and 8 are allowed. - - - If true, the length of the prepended length field is added - to the value of the prepended length field. - - The compensation value to add to the value of the length field. - - - - A decoder that splits the received {@link ByteBuf}s on line endings. - Both {@code "\n"} and {@code "\r\n"} are handled. - For a more general delimiter-based decoder, see {@link DelimiterBasedFrameDecoder}. - - - - Maximum length of a frame we're willing to decode. - - - Whether or not to throw an exception as soon as we exceed maxLength. - - - True if we're discarding input because we're already over maxLength. - - - - Initializes a new instance of the class. - - - the maximum length of the decoded frame. - A {@link TooLongFrameException} is thrown if - the length of the frame exceeds this value. - - - - - Initializes a new instance of the class. - - - the maximum length of the decoded frame. - A {@link TooLongFrameException} is thrown if - the length of the frame exceeds this value. - - - whether the decoded frame should strip out the - delimiter or not - - - If true, a {@link TooLongFrameException} is - thrown as soon as the decoder notices the length of the - frame will exceed maxFrameLength regardless of - whether the entire frame has been read. - If false, a {@link TooLongFrameException} is - thrown after the entire frame that exceeds - maxFrameLength has been read. - - - - - Create a frame out of the {@link ByteBuf} and return it. - - the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to - the {@link ByteBuf} from which to read data - - - - - An abstract that aggregates a series of message objects - into a single aggregated message. - 'A series of messages' is composed of the following: - a single start message which optionally contains the first part of the content, and - 1 or more content messages. The content of the aggregated message will be the merged - content of the start message and its following content messages. If this aggregator - encounters a content message where { @link #isLastContentMessage(ByteBufHolder)} - return true for, the aggregator will finish the aggregation and produce the aggregated - message and expect another start message. - - The type that covers both start message and content message - The type of the start message - The type of the content message - The type of the aggregated message - - - - Message to message decoder. - - - - - Decode from one message to an other. This method will be called for each written message that can be handled - by this encoder. - - the {@link ChannelHandlerContext} which this {@link MessageToMessageDecoder} belongs to - the message to decode to an other one - the {@link List} to which decoded messages should be added - - - - Returns {@code true} if the given message should be handled. If {@code false} it will be passed to the next - {@link ChannelHandler} in the {@link ChannelPipeline}. - - - - - Encode from one message to an other. This method will be called for each written message that can be handled - by this encoder. - @param context the {@link ChannelHandlerContext} which this {@link MessageToMessageEncoder} belongs to - @param message the message to encode to an other one - @param output the {@link List} into which the encoded message should be added - needs to do some kind of aggragation - @throws Exception is thrown if an error accour - - - - - A decoder that splits the received {@link ByteBuf}s dynamically by the - value of the Google Protocol Buffers - http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints - Base 128 Varints integer length field in the message. - For example: - - BEFORE DECODE (302 bytes) AFTER DECODE (300 bytes) - +--------+---------------+ +---------------+ - | Length | Protobuf Data |----->| Protobuf Data | - | 0xAC02 | (300 bytes) | | (300 bytes) | - +--------+---------------+ +---------------+ - - - - - An encoder that prepends the the Google Protocol Buffers - http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints - Base 128 Varints integer length field. - For example: - - BEFORE ENCODE (300 bytes) AFTER ENCODE (302 bytes) - +---------------+ +--------+---------------+ - | Protobuf Data |-------------->| Length | Protobuf Data | - | (300 bytes) | | 0xAC02 | (300 bytes) | - +---------------+ +--------+---------------+ - - - - Initializes a new instance of the class with the current system - character set. - - - - - Initializes a new instance of the class with the specified character - set.. - - Encoding. - - - Encodes the requested {@link String} into a {@link ByteBuf}. - A typical setup for a text-based line protocol in a TCP/IP socket would be: -
-             {@link ChannelPipeline} pipeline = ...;
-            
-             // Decoders
-             pipeline.addLast("frameDecoder", new {@link LineBasedFrameDecoder}(80));
-             pipeline.addLast("stringDecoder", new {@link StringDecoder}(CharsetUtil.UTF_8));
-            
-             // Encoder
-             pipeline.addLast("stringEncoder", new {@link StringEncoder}(CharsetUtil.UTF_8));
-             
- and then you can use a {@link String} instead of a {@link ByteBuf} - as a message: -
-             void channelRead({@link ChannelHandlerContext} ctx, {@link String} msg) {
-                 ch.write("Did you say '" + msg + "'?\n");
-             }
-             
-
- - - Initializes a new instance of the class with the current system - character set. - - - - - Initializes a new instance of the class with the specified character - set.. - - Encoding. - - - - A which is thrown when the length of the frame - decoded is greater than the allowed maximum. - - - - - Thrown if an unsupported message is received by an codec. - - -
-
+ + + + DotNetty.Codecs + + + + + http://www.faqs.org/rfcs/rfc3548.html + Table 1: The Base 64 Alphabet + + + + + http://www.faqs.org/rfcs/rfc3548.html + Table 2: The "URL and Filename safe" Base 64 Alphabet + + + + + Cumulates instances of by merging them into one , using memory + copies. + + + + + Cumulate instances of by add them to a and therefore + avoiding memory copy when possible. + + + Be aware that use a more complex indexing implementation so depending on your + use-case + and the decoder implementation this may be slower then just use the . + + + + + Determines whether only one message should be decoded per call. + Default is false as this has performance impacts. + + Is particularly useful in support of protocol upgrade scenarios. + + + + Returns the actual number of readable bytes in the internal cumulative + buffer of this decoder. You usually do not need to rely on this value + to write a decoder. Use it only when you must use it at your own risk. + This method is a shortcut to of . + + + + + An which is thrown by a codec. + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Adler32.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/CRC32.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Deflate.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Deflater.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/GZIPException.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/GZIPHeader.java + + http://www.ietf.org/rfc/rfc1952.txt + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/InfBlocks.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/InfCodes.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Inflate.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Inflater.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/InfTree.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/JZlib.java + + + + Creates a new zlib encoder with the specified {@code compressionLevel}, + the specified {@code windowBits}, the specified {@code memLevel}, and + the specified wrapper. + + @param compressionLevel + {@code 1} yields the fastest compression and {@code 9} yields the + best compression. {@code 0} means no compression. The default + compression level is {@code 6}. + @param windowBits + The base two logarithm of the size of the history buffer. The + value should be in the range {@code 9} to {@code 15} inclusive. + Larger values result in better compression at the expense of + memory usage. The default value is {@code 15}. + @param memLevel + How much memory should be allocated for the internal compression + state. {@code 1} uses minimum memory and {@code 9} uses maximum + memory. Larger values result in better and faster compression + at the expense of memory usage. The default value is {@code 8} + + @throws CompressionException if failed to initialize zlib + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/StaticTree.java + + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/Tree.java + + + + Close this {@link ZlibEncoder} and so finish the encoding. + + The returned {@link ChannelFuture} will be notified once the + operation completes. + + + The container file formats that wrap the stream compressed by the DEFLATE + algorithm. + + + The ZLIB wrapper as specified in RFC 1950. + + + The GZIP wrapper as specified in RFC 1952. + + + Raw DEFLATE stream only (no header and no footer). + + + Try {@link #ZLIB} first and then {@link #NONE} if the first attempt fails. + Please note that you can specify this wrapper type only when decompressing. + + + + https://github.com/ymnk/jzlib/blob/master/src/main/java/com/jcraft/jzlib/ZStream.java + + + + Those methods are expected to be override by Inflater and Deflater. + In the future, they will become abstract methods. + + + + A which is thrown when the received frame data could not + be decoded by an inbound handler. + + + + + A decoder that splits the received by one or more + delimiters.It is particularly useful for decoding the frames which ends + with a delimiter such as or + +

Specifying more than one delimiter

+ allows you to specify more than one + delimiter. If more than one delimiter is found in the buffer, it chooses + the delimiter which produces the shortest frame. For example, if you have + the following data in the buffer: + +--------------+ + | ABC\nDEF\r\n | + +--------------+ + a will choose '\n' as the first delimiter and produce two + frames: + +-----+-----+ + | ABC | DEF | + +-----+-----+ + rather than incorrectly choosing '\r\n' as the first delimiter: + +----------+ + | ABC\nDEF | + +----------+ +
+
+ + Common constructor + + The maximum length of the decoded frame + NOTE: A see is thrown if the length of the frame exceeds this + value. + + whether the decoded frame should strip out the delimiter or not + + If true, a is + thrown as soon as the decoder notices the length of the + frame will exceedmaxFrameLength regardless of + whether the entire frame has been read. + If false, a is + thrown after the entire frame that exceeds maxFrameLength has been read. + + delimiters + + + Returns true if the delimiters are "\n" and "\r\n" + + + ReturnsReturn true if the current instance is a subclass of DelimiterBasedFrameDecoder + + + Create a frame out of the and return it + + the which this + belongs to + + the from which to read data + + the which represent the frame or null if no frame could be + created. + + + + Returns the number of bytes between the readerIndex of the haystack and + the first needle found in the haystack. -1 is returned if no needle is + found in the haystack. + + + Returns a null (0x00) delimiter, which could be used for Flash XML socket or any similar protocols + + + + Returns {@code CR ('\r')} and {@code LF ('\n')} delimiters, which could + be used for text-based line protocols. + + + + + Splits a byte stream of JSON objects and arrays into individual objects/arrays and passes them up the + . + This class does not do any real parsing or validation. A sequence of bytes is considered a JSON object/array + if it contains a matching number of opening and closing braces/brackets. It's up to a subsequent + + to parse the JSON text into a more usable form i.e.a POCO. + + + + + + Create a new instance. + + + The maximum length of the frame. If the length of the frame is + greater than this value then will be thrown. + + The offset of the length field. + The length of the length field. + + + + Create a new instance. + + + The maximum length of the frame. If the length of the frame is + greater than this value then will be thrown. + + The offset of the length field. + The length of the length field. + The compensation value to add to the value of the length field. + the number of first bytes to strip out from the decoded frame. + + + + Create a new instance. + + + The maximum length of the frame. If the length of the frame is + greater than this value then will be thrown. + + The offset of the length field. + The length of the length field. + The compensation value to add to the value of the length field. + the number of first bytes to strip out from the decoded frame. + + If true, a is thrown as soon as the decoder notices the length + of the frame will exceeed regardless of whether the entire frame has been + read. If false, a is thrown after the entire frame that exceeds + has been read. + Defaults to true in other overloads. + + + + + Create a new instance. + + The of the lenght field. + + The maximum length of the frame. If the length of the frame is + greater than this value then will be thrown. + + The offset of the length field. + The length of the length field. + The compensation value to add to the value of the length field. + the number of first bytes to strip out from the decoded frame. + + If true, a is thrown as soon as the decoder notices the length + of the frame will exceeed regardless of whether the entire frame has been + read. If false, a is thrown after the entire frame that exceeds + has been read. + Defaults to true in other overloads. + + + + + Create a frame out of the and return it. + + + The which this belongs + to. + + The from which to read data. + The which represents the frame or null if no frame could be created. + + + + Decodes the specified region of the buffer into an unadjusted frame length. The default implementation is + capable of decoding the specified region into an unsigned 8/16/24/32/64 bit integer. Override this method to + decode the length field encoded differently. + Note that this method must not modify the state of the specified buffer (e.g. + , + , and the content of the buffer.) + + The buffer we'll be extracting the frame length from. + The offset from the absolute . + The length of the framelenght field. Expected: 1, 2, 3, 4, or 8. + The preferred of buffer. + A long integer that represents the unadjusted length of the next frame. + + + + An encoder that prepends the length of the message. The length value is + prepended as a binary form. +

+ For example, {@link LengthFieldPrepender}(2) will encode the + following 12-bytes string: +

+                    +----------------+
+                    | "HELLO, WORLD" |
+                    +----------------+
+                
+ into the following: +
+                    +--------+----------------+
+                    + 0x000C | "HELLO, WORLD" |
+                    +--------+----------------+
+                
+ If you turned on the {@code lengthIncludesLengthFieldLength} flag in the + constructor, the encoded data would look like the following + (12 (original data) + 2 (prepended data) = 14 (0xE)): +
+                    +--------+----------------+
+                    + 0x000E | "HELLO, WORLD" |
+                    +--------+----------------+
+                
+
+
+ + + Creates a new instance. + + + The length of the prepended length field. + Only 1, 2, 3, 4, and 8 are allowed. + + + + + Creates a new instance. + + + The length of the prepended length field. + Only 1, 2, 3, 4, and 8 are allowed. + + + If true, the length of the prepended length field is added + to the value of the prepended length field. + + + + + Creates a new instance. + + + The length of the prepended length field. + Only 1, 2, 3, 4, and 8 are allowed. + + The compensation value to add to the value of the length field. + + + + Creates a new instance. + + + The length of the prepended length field. + Only 1, 2, 3, 4, and 8 are allowed. + + + If true, the length of the prepended length field is added + to the value of the prepended length field. + + The compensation value to add to the value of the length field. + + + + Creates a new instance. + + The of the length field. + + The length of the prepended length field. + Only 1, 2, 3, 4, and 8 are allowed. + + + If true, the length of the prepended length field is added + to the value of the prepended length field. + + The compensation value to add to the value of the length field. + + + + A decoder that splits the received {@link ByteBuf}s on line endings. + Both {@code "\n"} and {@code "\r\n"} are handled. + For a more general delimiter-based decoder, see {@link DelimiterBasedFrameDecoder}. + + + + Maximum length of a frame we're willing to decode. + + + Whether or not to throw an exception as soon as we exceed maxLength. + + + True if we're discarding input because we're already over maxLength. + + + + Initializes a new instance of the class. + + + the maximum length of the decoded frame. + A {@link TooLongFrameException} is thrown if + the length of the frame exceeds this value. + + + + + Initializes a new instance of the class. + + + the maximum length of the decoded frame. + A {@link TooLongFrameException} is thrown if + the length of the frame exceeds this value. + + + whether the decoded frame should strip out the + delimiter or not + + + If true, a {@link TooLongFrameException} is + thrown as soon as the decoder notices the length of the + frame will exceed maxFrameLength regardless of + whether the entire frame has been read. + If false, a {@link TooLongFrameException} is + thrown after the entire frame that exceeds + maxFrameLength has been read. + + + + + Create a frame out of the {@link ByteBuf} and return it. + + the {@link ChannelHandlerContext} which this {@link ByteToMessageDecoder} belongs to + the {@link ByteBuf} from which to read data + + + + + An abstract that aggregates a series of message objects + into a single aggregated message. + 'A series of messages' is composed of the following: + a single start message which optionally contains the first part of the content, and + 1 or more content messages. The content of the aggregated message will be the merged + content of the start message and its following content messages. If this aggregator + encounters a content message where { @link #isLastContentMessage(ByteBufHolder)} + return true for, the aggregator will finish the aggregation and produce the aggregated + message and expect another start message. + + The type that covers both start message and content message + The type of the start message + The type of the content message + The type of the aggregated message + + + + Message to message decoder. + + + + + Decode from one message to an other. This method will be called for each written message that can be handled + by this encoder. + + the {@link ChannelHandlerContext} which this {@link MessageToMessageDecoder} belongs to + the message to decode to an other one + the {@link List} to which decoded messages should be added + + + + Returns {@code true} if the given message should be handled. If {@code false} it will be passed to the next + {@link ChannelHandler} in the {@link ChannelPipeline}. + + + + + Encode from one message to an other. This method will be called for each written message that can be handled + by this encoder. + @param context the {@link ChannelHandlerContext} which this {@link MessageToMessageEncoder} belongs to + @param message the message to encode to an other one + @param output the {@link List} into which the encoded message should be added + needs to do some kind of aggragation + @throws Exception is thrown if an error accour + + + + + A decoder that splits the received {@link ByteBuf}s dynamically by the + value of the Google Protocol Buffers + http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints + Base 128 Varints integer length field in the message. + For example: + + BEFORE DECODE (302 bytes) AFTER DECODE (300 bytes) + +--------+---------------+ +---------------+ + | Length | Protobuf Data |----->| Protobuf Data | + | 0xAC02 | (300 bytes) | | (300 bytes) | + +--------+---------------+ +---------------+ + + + + + An encoder that prepends the the Google Protocol Buffers + http://code.google.com/apis/protocolbuffers/docs/encoding.html#varints + Base 128 Varints integer length field. + For example: + + BEFORE ENCODE (300 bytes) AFTER ENCODE (302 bytes) + +---------------+ +--------+---------------+ + | Protobuf Data |-------------->| Length | Protobuf Data | + | (300 bytes) | | 0xAC02 | (300 bytes) | + +---------------+ +--------+---------------+ + + + + Initializes a new instance of the class with the current system + character set. + + + + + Initializes a new instance of the class with the specified character + set.. + + Encoding. + + + Encodes the requested {@link String} into a {@link ByteBuf}. + A typical setup for a text-based line protocol in a TCP/IP socket would be: +
+             {@link ChannelPipeline} pipeline = ...;
+            
+             // Decoders
+             pipeline.addLast("frameDecoder", new {@link LineBasedFrameDecoder}(80));
+             pipeline.addLast("stringDecoder", new {@link StringDecoder}(CharsetUtil.UTF_8));
+            
+             // Encoder
+             pipeline.addLast("stringEncoder", new {@link StringEncoder}(CharsetUtil.UTF_8));
+             
+ and then you can use a {@link String} instead of a {@link ByteBuf} + as a message: +
+             void channelRead({@link ChannelHandlerContext} ctx, {@link String} msg) {
+                 ch.write("Did you say '" + msg + "'?\n");
+             }
+             
+
+ + + Initializes a new instance of the class with the current system + character set. + + + + + Initializes a new instance of the class with the specified character + set.. + + Encoding. + + + + A which is thrown when the length of the frame + decoded is greater than the allowed maximum. + + + + + Thrown if an unsupported message is received by an codec. + + +
+
diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml.meta index bfd9f27..27299e2 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Codecs.xml.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: cf54e07b609f28c4c9ed1409ba230ad6 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: cf54e07b609f28c4c9ed1409ba230ad6 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.mdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.mdb.meta index a29dcba..90306fb 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.mdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.mdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 206957aa7baaebe49899acc8f0e8c89a -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 206957aa7baaebe49899acc8f0e8c89a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.meta index fc25e08..6e634b7 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Common.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: 1a268e2cd81ae1240a54deedb4231b26 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 1a268e2cd81ae1240a54deedb4231b26 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Common.pdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Common.pdb.meta index a524ee8..e1e1ec5 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Common.pdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Common.pdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: a21e213b5e1e0684cb3e00a30252902f -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: a21e213b5e1e0684cb3e00a30252902f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml b/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml index f7be6b7..5e05d56 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml @@ -1,2149 +1,2149 @@ - - - - DotNetty.Common - - - - - Abstract base class for implementations - - - - Creates an instance of . - - - Creates an instance of . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Abstract base class for s that need to support scheduling. - - - - - Cancel all scheduled tasks - This method MUST be called only when is true. - - - - - Parent . - - - - - Returns true if the current belongs to this event loop, - false otherwise. - - - It is a convenient way to determine whether code can be executed directly or if it - should be posted for execution to this executor instance explicitly to ensure execution in the loop. - - - - - Returns true if the given belongs to this event loop, - false> otherwise. - - - - - Provides an access to a set of s it manages. - - - - - Returns list of owned event executors. - - - - - Returns true if and only if this executor is being shut down via . - - - - - Terminates this and all its s. - - for completion of termination. - - - - Terminates this and all its s. - - for completion of termination. - - - - A for completion of termination. . - - - - - Returns . - - - - - Executes the given task. - - Threading specifics are determined by IEventExecutor implementation. - - - - Executes the given action. - - - parameter is useful to when repeated execution of an action against - different objects is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Executes the given . - - Threading specifics are determined by IEventExecutor implementation. - - - - Executes the given action. - - - and parameters are useful when repeated execution of - an action against different objects in different context is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Returns true if this executor has been shut down, false otherwise. - - - - - Returns true if all tasks have completed following shut down. - - - Note that is never true unless was called first. - - - - - Executes the given function and returns indicating completion status and result of - execution. - - - Threading specifics are determined by IEventExecutor implementation. - - - - - Executes the given action and returns indicating completion status and result of execution. - - - Threading specifics are determined by IEventExecutor implementation. - - - - - Executes the given action and returns indicating completion status and result of execution. - - - parameter is useful to when repeated execution of an action against - different objects is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Executes the given action and returns indicating completion status and result of execution. - - - parameter is useful to when repeated execution of an action against - different objects is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Executes the given action and returns indicating completion status and result of execution. - - - and parameters are useful when repeated execution of - an action against different objects in different context is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Executes the given action and returns indicating completion status and result of execution. - - - and parameters are useful when repeated execution of - an action against different objects in different context is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Creates and executes a one-shot action that becomes enabled after the given delay. - - the task to execute - the time from now to delay execution - an representing pending completion of the task. - - - - Schedules the given action for execution after the specified delay would pass. - - - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - parameter is useful to when repeated execution of an action against - different objects is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - and parameters are useful when repeated execution of - an action against different objects in different context is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution at a fixed frequency after the specified delay would pass. - - - - - - - - - Schedules the given action for execution at a fixed frequency after the specified delay would pass. - - - - - - - - - Schedules the given action for execution at a fixed delay after the specified delay would pass. - - - - - - - - - Schedules the given action for execution at a fixed delay after the specified delay would pass. - - - - - - - - - Schedules the given action for execution after the specified delay would pass. - - - parameter is useful to when repeated execution of an action against - different objects is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - parameter is useful to when repeated execution of an action against - different objects is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - and parameters are useful when repeated execution of - an action against different objects in different context is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Schedules the given action for execution after the specified delay would pass. - - - and parameters are useful when repeated execution of - an action against different objects in different context is needed. - Threading specifics are determined by IEventExecutor implementation. - - - - - Reuse ReusableScheduledTask to optimize GC. - - - - - backed by a single thread. - - - - Creates a new instance of . - - - Creates a new instance of . - - - - Task Scheduler that will post work to this executor's queue. - - - - - Allows to track whether executor is progressing through its backlog. Useful for diagnosing / mitigating stalls due to blocking calls in conjunction with IsBacklogEmpty property. - - - - - Indicates whether executor's backlog is empty. Useful for diagnosing / mitigating stalls due to blocking calls in conjunction with Progress property. - - - - - Gets length of backlog of tasks queued for immediate execution. - - - - - - - - - - - - - - - - - - - - - - - Adds an which will be executed on shutdown of this instance. - - The to run on shutdown. - - - - Removes a previously added from the collection of s which will be - executed on shutdown of this instance. - - The to remove. - - - - - - - Removes all variables bound to the current thread. This operation is useful when you - are in a container environment, and you don't want to leave the thread local variables in the threads you do not - manage. - - - - - Destroys the data structure that keeps all variables accessed from - non-s. This operation is useful when you are in a container environment, and - you do not want to leave the thread local variables in the threads you do not manage. Call this method when - your application is being unloaded from the container. - - - - - Sets the value to uninitialized; a proceeding call to get() will trigger a call to GetInitialValue(). - - - - - - Returns the number of thread local variables bound to the current thread. - - - - - Gets or sets current value for the current thread. - - - - - Returns the current value for the specified thread local map. - The specified thread local map must be for the current thread. - - - - - Set the value for the specified thread local map. The specified thread local map must be for the current thread. - - - - - Returns true if and only if this thread-local variable is set. - - - - - Returns true if and only if this thread-local variable is set. - The specified thread local map must be for the current thread. - - - - - Returns the initial value for this thread-local variable. - - - - - Sets the value to uninitialized for the specified thread local map; - a proceeding call to will trigger a call to . - The specified thread local map must be for the current thread. - - - The from which this should be removed. - - - - - Invoked when this thread local variable is removed by . - - - - - The internal data structure that stores the thread-local variables for DotNetty and all - s. Note that this class is for internal use only and is subject to change at any - time. Use unless you know what you are doing. - - - - - Used by . - - - - - Sets a value at the given index in this . - - The desired index at which a value should be set. - The value to set at the given index. - true if and only if a new thread-local variable has been created. - - - - Resets the . Be aware this will only reset the current internal - position and not shrink the internal char array. - - - - - Create a new ascii string, this method assumes all chars has been sanitized to ascii chars when appending - to the array. - - - - Forked from - JCTools - . - A concurrent access enabling class used by circular array based queues this class exposes an offset computation - method along with differently memory fenced load/store methods into the underlying array. The class is pre-padded and - the array is padded on either side to help with False sharing prvention. It is expected theat subclasses handle post - padding. -

- Offset calculation is separate from access to enable the reuse of a give compute offset. -

- Load/Store methods using a - buffer - parameter are provided to allow the prevention of field reload after a - LoadLoad barrier. -

- - -

- Calculates an element offset based on a given array index. - - The desirable element index. - The offset in bytes within the array for a given index. -
- - - A plain store (no ordering/fences) of an element to a given offset. - - Computed via . - A kitty. - - - - An ordered store(store + StoreStore barrier) of an element to a given offset. - - Computed via . - An orderly kitty. - - - - A plain load (no ordering/fences) of an element from a given offset. - - Computed via . - The element at the offset. - - - - A volatile load (load + LoadLoad barrier) of an element from a given offset. - - Computed via . - The element at the offset. - - - - A skeletal implementation of . This class implements - all methods that have a parameter by default to call - specific logger methods such as or . - - - - - Creates a new instance. - - A friendly name for the new logger instance. - - - - Holds the results of formatting done by . - - - - - Internal-use-only logger used by DotNetty. DO NOT - access this class outside of DotNetty. - - - - - Return the name of this instance. - - name of this logger instance - - - - Is this logger instance enabled for the TRACE level? - - true if this Logger is enabled for level TRACE, false otherwise. - - - - Log a message object at level TRACE. - - the message object to be logged - - - - Log a message at level TRACE according to the specified format and - argument. - - This form avoids superfluous object creation when the logger is disabled - for level TRACE. - - - the format string - the argument - - - - Log a message at level TRACE according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level TRACE. - - - the format string - the first argument - the second argument - - - - Log a message at level TRACE according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level TRACE. However, this variant incurs the hidden - (and relatively small) cost of creating an object[] - before invoking the method, - even if this logger is disabled for TRACE. The variants - and - arguments exist solely to avoid this hidden cost. - - - the format string - an array of arguments - - - - Log an exception at level TRACE with an accompanying message. - - the message accompanying the exception - the exception to log - - - - Log an exception at level TRACE. - - the exception to log - - - - Is this logger instance enabled for the DEBUG level? - - true if this Logger is enabled for level DEBUG, false otherwise. - - - - Log a message object at level DEBUG. - - the message object to be logged - - - - Log a message at level DEBUG according to the specified format and - argument. - - This form avoids superfluous object creation when the logger is disabled - for level DEBUG. - - - the format string - the argument - - - - Log a message at level DEBUG according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level DEBUG. - - - the format string - the first argument - the second argument - - - - Log a message at level DEBUG according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level DEBUG. However, this variant incurs the hidden - (and relatively small) cost of creating an object[] - before invoking the method, - even if this logger is disabled for DEBUG. The variants - and - arguments exist solely to avoid this hidden cost. - - - the format string - an array of arguments - - - - Log an exception at level DEBUG with an accompanying message. - - the message accompanying the exception - the exception to log - - - - Log an exception at level DEBUG. - - the exception to log - - - - Is this logger instance enabled for the INFO level? - - true if this Logger is enabled for level INFO, false otherwise. - - - - Log a message object at level INFO. - - the message object to be logged - - - - Log a message at level INFO according to the specified format and - argument. - - This form avoids superfluous object creation when the logger is disabled - for level INFO. - - - the format string - the argument - - - - Log a message at level INFO according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level INFO. - - - the format string - the first argument - the second argument - - - - Log a message at level INFO according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level INFO. However, this variant incurs the hidden - (and relatively small) cost of creating an object[] - before invoking the method, - even if this logger is disabled for INFO. The variants - and - arguments exist solely to avoid this hidden cost. - - - the format string - an array of arguments - - - - Log an exception at level INFO with an accompanying message. - - the message accompanying the exception - the exception to log - - - - Log an exception at level INFO. - - the exception to log - - - - Is this logger instance enabled for the WARN level? - - true if this Logger is enabled for level WARN, false otherwise. - - - - Log a message object at level WARN. - - the message object to be logged - - - - Log a message at level WARN according to the specified format and - argument. - - This form avoids superfluous object creation when the logger is disabled - for level WARN. - - - the format string - the argument - - - - Log a message at level WARN according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level WARN. However, this variant incurs the hidden - (and relatively small) cost of creating an object[] - before invoking the method, - even if this logger is disabled for WARN. The variants - and - arguments exist solely to avoid this hidden cost. - - - the format string - an array of arguments - - - - Log a message at level WARN according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level WARN. - - - the format string - the first argument - the second argument - - - - Log an exception at level WARN with an accompanying message. - - the message accompanying the exception - the exception to log - - - - Log an exception at level WARN. - - the exception to log - - - - Is this logger instance enabled for the ERROR level? - - true if this Logger is enabled for level ERROR, false otherwise. - - - - Log a message object at level ERROR. - - the message object to be logged - - - - Log a message at level ERROR according to the specified format and - argument. - - This form avoids superfluous object creation when the logger is disabled - for level ERROR. - - - the format string - the argument - - - - Log a message at level ERROR according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level ERROR. - - - the format string - the first argument - the second argument - - - - Log a message at level ERROR according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for level ERROR. However, this variant incurs the hidden - (and relatively small) cost of creating an object[] - before invoking the method, - even if this logger is disabled for ERROR. The variants - and - arguments exist solely to avoid this hidden cost. - - - the format string - an array of arguments - - - - Log an exception at level ERROR with an accompanying message. - - the message accompanying the exception - the exception to log - - - - Log an exception at level ERROR. - - the exception to log - - - - Is the logger instance enabled for the specified ? - - log level - true if this Logger is enabled for the specified , false otherwise. - - - - Log a message object at a specified . - - log level - the message object to be logged - - - - Log a message at a specified according to the specified format and - argument. - - This form avoids superfluous object creation when the logger is disabled - for the specified . - - - log level - the format string - the argument - - - - Log a message at a specified according to the specified format and - arguments. - - This form avoids superfluous object creation when the logger is disabled - for the specified . - - - log level - the format string - the first argument - the second argument - - - - Log a message at the specified according to the specified format - and arguments. - - This form avoids superfluous string concatenation when the logger - is disabled for the specified . However, this variant incurs the hidden - (and relatively small) cost of creating an object[] before invoking the method, - even if this logger is disabled for the specified . The variants - and - arguments exist solely - in order to avoid this hidden cost. - - - log level - the format string - an array of arguments - - - - Log an exception at the specified with an - accompanying message. - - log level - the message accompanying the exception - the exception to log - - - - Log an exception at the specified . - - log level - the exception to log - - - - Creates an or changes the default factory - implementation. This factory allows you to choose what logging framework - DotNetty should use. The default factory is own with registered. - You can change it to your preferred logging framework before other DotNetty classes are loaded: -
-                    InternalLoggerFactory.DefaultFactory = new LoggerFactory();
-                
- Please note that the new default factory is effective only for the classes - which were loaded after the default factory is changed. Therefore, should be set as early - as possible and should not be called more than once. -
-
- - - Creates a new logger instance with the name of the specified type. - - type where logger is used - logger instance - - - - Creates a new logger instance with the name of the specified type. - - type where logger is used - logger instance - - - - Creates a new logger instance with the specified name. - - logger name - logger instance - - - - The log level that can log at. - - - - - 'TRACE' log level. - - - - - 'DEBUG' log level. - - - - - 'INFO' log level. - - - - - 'WARN' log level. - - - - - 'ERROR' log level. - - - - - Formats messages according to very simple substitution rules. Substitutions can be made 1, 2 or more arguments. - For example, - - MessageFormatter.Format("Hi {}.", "there") - - - will return the string "Hi there.". - - - The {} pair is called the formatting anchor. It serves to designate the location where arguments need - to be substituted within the message pattern. - - - In case your message contains the '{' or the '}' character, you do not have to do anything special unless the - '}' character immediately follows '{'. For example, - - - MessageFormatter.Format("Set {1,2,3} is not equal to {}.", "1,2"); - - - will return the string "Set {1,2,3} is not equal to 1,2.". - - - If for whatever reason you need to place the string "{}" in the message without its formatting anchor - meaning, then you need to escape the '{' character with '\', that is the backslash character. Only the '{' - character should be escaped. There is no need to escape the '}' character. For example, - - - MessageFormatter.Format("Set \\{} is not equal to {}.", "1,2"); - - - will return the string "Set {} is not equal to 1,2.". - - - The escaping behavior just described can be overridden by escaping the escape character '\'. Calling - - - MessageFormatter.Format("File name is C:\\\\{}.", "file.zip"); - - - will return the string "File name is C:\file.zip". - - - - - - - - - Performs single argument substitution for the given . - - For example, - - - MessageFormatter.Format("Hi {}.", "there"); - - - will return the string "Hi there.". - - - The message pattern which will be parsed and formatted - The argument to be substituted in place of the formatting anchor - The formatted message - - - - Performs a two argument substitution for the given . - - For example, - - - MessageFormatter.Format("Hi {}. My name is {}.", "Alice", "Bob"); - - - will return the string "Hi Alice. My name is Bob.". - - - The message pattern which will be parsed and formatted - The argument to be substituted in place of the first formatting anchor - The argument to be substituted in place of the second formatting anchor - The formatted message - - - - Same principle as the and - methods, except that any number of arguments can be passed in an array. - - The message pattern which will be parsed and formatted - An array of arguments to be substituted in place of formatting anchors - The formatted message - - - Length of a valid MAC address. - - - Obtains the best MAC address found on local network interfaces. - Generally speaking, an active network interface used on public - networks is better than a local network interface. - byte array containing a MAC. null if no MAC can be found. - - - byte array of a MAC address. - hex formatted MAC address. - - - positive - current is better, 0 - cannot tell from MAC addr, negative - candidate is better. - - - positive - current is better, 0 - cannot tell, negative - candidate is better - - - - Forked from JCTools. - A Multi-Producer-Single-Consumer queue based on a . This implies - that any thread may call the Enqueue methods, but only a single thread may call poll/peek for correctness to - maintained. - - This implementation follows patterns documented on the package level for False Sharing protection. - - - This implementation is using the Fast Flow - method for polling from the queue (with minor change to correctly publish the index) and an extension of - the Leslie Lamport concurrent queue algorithm (originated by Martin Thompson) on the producer side. - - - The type of each item in the queue. - - - - Lock free Enqueue operation, using a single compare-and-swap. As the class name suggests, access is - permitted to many threads concurrently. - - The item to enqueue. - true if the item was added successfully, otherwise false. - - - - - A wait-free alternative to , which fails on compare-and-swap failure. - - The item to enqueue. - 1 if next element cannot be filled, -1 if CAS failed, and 0 if successful. - - - - Lock free poll using ordered loads/stores. As class name suggests, access is limited to a single thread. - - The dequeued item. - true if an item was retrieved, otherwise false. - - - - - Lock free peek using ordered loads. As class name suggests access is limited to a single thread. - - The peeked item. - true if an item was retrieved, otherwise false. - - - - - Returns the number of items in this . - - - - - A plain store (no ordering/fences) of an element to a given offset. - - The element type. - The source buffer. - Computed via - An orderly kitty. - - - - An ordered store(store + StoreStore barrier) of an element to a given offset. - - The element type. - The source buffer. - Computed via - - - - - A plain load (no ordering/fences) of an element from a given offset. - - The element type. - The source buffer. - Computed via - The element at the given in the given . - - - - A volatile load (load + LoadLoad barrier) of an element from a given offset. - - The element type. - The source buffer. - Computed via - The element at the given in the given . - - - - Gets the offset in bytes within the array for a given index. - - The desired element index. - Mask for the index. - The offset (in bytes) within the array for a given index. - - - - Called from a producer thread subject to the restrictions appropriate to the implementation and - according to the interface. - - The element to enqueue. - true if the element was inserted, false iff the queue is full. - - - - Called from the consumer thread subject to the restrictions appropriate to the implementation and - according to the interface. - - A message from the queue if one is available, null iff the queue is empty. - - - - Called from the consumer thread subject to the restrictions appropriate to the implementation and - according to the interface. - - A message from the queue if one is available, null iff the queue is empty. - - - - A collection of utility methods to retrieve and parse the values of the system properties (Environment variables). - - - - - Returns true if and only if the system property with the specified key - exists. - - - - - Returns the value of the system property with the specified - key, while falling back to null if the property access fails. - - the property value or null - - - - Returns the value of the system property with the specified - key, while falling back to the specified default value if - the property access fails. - - - the property value. - def if there's no such property or if an access to the - specified property is not allowed. - - - - - Returns the value of the system property with the specified - key, while falling back to the specified default value if - the property access fails. - - - the property value or def if there's no such property or - if an access to the specified property is not allowed. - - - - - Returns the value of the system property with the specified - key, while falling back to the specified default value if - the property access fails. - - - the property value. - def if there's no such property or if an access to the - specified property is not allowed. - - - - - Returns the value of the system property with the specified - key, while falling back to the specified default value if - the property access fails. - - - the property value. - def if there's no such property or if an access to the - specified property is not allowed. - - - - - Reference counting interface for reusable objects - - - - - Returns the reference count of this object - - - - - Increases the reference count by 1 - - - - - Increases the reference count by - - - - - Records the current access location of this object for debugging purposes. - If this object is determined to be leaked, the information recorded by this operation will be provided to you - via . This method is a shortcut to with null as - an argument. - - - - - - Records the current access location of this object with an additonal arbitrary information for debugging - purposes. If this object is determined to be leaked, the information recorded by this operation will be - provided to you via . - - - - - Decreases the reference count by 1 and deallocates this object if the reference count reaches 0. - - true if and only if the reference count is 0 and this object has been deallocated - - - - Decreases the reference count by and deallocates this object if the reference count - reaches 0. - - true if and only if the reference count is 0 and this object has been deallocated - - - - A hint object that provides human-readable message for easier resource leak tracking. - - - - - Returns a human-readable message that potentially enables easier resource leak tracking. - - - - - - Records the caller's current stack trace so that the can tell where the - leaked - resource was accessed lastly. This method is a shortcut to with null as an - argument. - - - - - Records the caller's current stack trace and the specified additional arbitrary information - so that the can tell where the leaked resource was accessed lastly. - - - - - - Close the leak so that does not warn about leaked resources. - - true if called first time, false if called already - - - - Represents the level of resource leak detection. - - - - - Disables resource leak detection. - - - - - Enables simplistic sampling resource leak detection which reports there is a leak or not, - at the cost of small overhead (default). - - - - - Enables advanced sampling resource leak detection which reports where the leaked object was accessed - recently at the cost of high overhead. - - - - - Enables paranoid resource leak detection which reports where the leaked object was accessed recently, - at the cost of the highest possible overhead (for testing purposes only). - - - - Returns true if resource leak detection is enabled. - - - - Gets or sets resource leak detection level - - - - - Creates a new which is expected to be closed - when the - related resource is deallocated. - - the or null - - - - Schedules the specified to run when the specified dies. - - - - - Cancels the task scheduled via . - - - - - Waits until the thread of this watcher has no threads to watch and terminates itself. - Because a new watcher thread will be started again on , - this operation is only useful when you want to ensure that the watcher thread is terminated - after your application is shut down and there's no chance of calling - afterwards. - - - true if and only if the watcher thread has been terminated. - - - - Allocate a new or return null if not possible. - - - - Base implementation of . - - - Creates a new instance. - - - - Extension methods used for slicing byte arrays - - - - - Merge the byte arrays into one byte array. - - - - - During normal use cases the AsciiString should be immutable, but if the - underlying array is shared, and changes then this needs to be called. - - - - - Implementation of the java.concurrent.util AtomicReference type. - - - - - Sets the initial value of this to . - - - - - Default constructor - - - - - The current value of this - - - - - If equals , then set the Value to - - Returns true if was set, false otherwise. - - - - - Implicit conversion operator = automatically casts the to an instance of - - - - - - Implicit conversion operator = allows us to cast any type directly into a - instance. - - - - - - - Key which can be used to access out of the . Be aware that - it is not be possible to have multiple keys with the same name. - - - the type of the which can be accessed via this . - - - - Returns the singleton instance of the {@link AttributeKey} which has the specified name. - - - Returns true if a exists for the given name. - - - - Creates a new for the given name or fail with an - if a for the given name exists. - - - - - Provides a mechanism to iterate over a collection of bytes. - - - - - Aborts on a NUL (0x00). - - - - - Aborts on a non-NUL (0x00). - - - - - Aborts on a CR ('\r'). - - - - - Aborts on a non-CR ('\r'). - - - - - Aborts on a LF ('\n'). - - - - - Aborts on a non-LF ('\n'). - - - - - Aborts on a CR (';'). - - - - - Aborts on a comma (','). - - - - - Aborts on a ascii space character (' '). - - - - - Aborts on a CR ('\r') or a LF ('\n'). - - - - - Aborts on a byte which is neither a CR ('\r') nor a LF ('\n'). - - - - - Aborts on a linear whitespace (a ' ' or a '\t'). - - - - - Aborts on a byte which is not a linear whitespace (neither ' ' nor '\t'). - - - - - A pool of s. - - - - Shortcut of this.ValueOf(firstNameComponent.Name + "#" + secondNameComponent). - - - - Returns the which is assigned to the specified name. - If there's no such , a new one will be created and returned. - Once created, the subsequent calls with the same name will always return the previously created one - (i.e. singleton.) - - the name of the - - - Returns true if a exists for the given name. - - - - Creates a new for the given name or fail with an - if a for the given name exists. - - - - - Default implementation which use simple synchronization per bucket to keep the memory - overhead - as low as possible. - - - - - Creates a new timer. - - the interval between two consecutive ticks - the size of the wheel - The maximum number of pending timeouts after which call to - newTimeout will result in being thrown. - No maximum pending timeouts limit is assumed if this value is 0 or negative. - if either of tickInterval and ticksPerWheel is <= 0 - - - - Starts the background thread explicitly. The background thread will - start automatically on demand even if you did not call this method. - - if this timer has been - stopped already. - - - - calculate timer firing time from startTime and current tick number, - then wait until that goal has been reached. - - long.MinValue if received a shutdown request, - current time otherwise (with long.MinValue changed by +1) - - - - - Bucket that stores HashedWheelTimeouts. These are stored in a linked-list like datastructure to allow easy - removal of HashedWheelTimeouts in the middle. Also the HashedWheelTimeout act as nodes themself and so no - extra object creation is needed. - - - - - Add a to this bucket. - - - - - Expire all s for the given deadline. - - - - - Clear this bucket and return all not expired / cancelled s. - - - - An attribute which allows to store a value reference. It may be updated atomically and so is thread-safe. - the type of the value it holds. - - - - Returns the key of this attribute. - - - - - Returns the current value, which may be null - - - - - Sets the value - - - - - Atomically sets to the given value and returns the old value which may be null if non was set before. - - - - - Atomically sets to the given value if this 's value is null. - If it was not possible to set the value as it contains a value it will just return the current value. - - - - - Removes this attribute from the and returns the old value. Subsequent - - calls will return null. - If you only want to return the old value and clear the while still keep it in - use with a value of null. - - - - - Atomically sets the value to the given updated value if the current value == the expected value. - If it the set was successful it returns true otherwise false. - - - - - Removes this attribute from the . Subsequent calls will return - null. - If you only want to remove the value and clear the while still keep it in - use with a value of null. - - - - Holds s which can be accessed via . - Implementations must be Thread-safe. - - - - Get the for the given . This method will never return - null, but may return an which does not have a value set yet. - - - - - Returns true if and only if the given exists in this - . - - - - Start is the inclusive start index to begin the subsequence. - End is the exclusive end index to end the subsequence. - - - - A singleton which is safe to compare via the == operator. Created and managed by - . - - - - Returns the unique number assigned to this . - - - Returns the name of this . - - - - - Exception thrown during instances where a reference count is used incorrectly - - - - - A handle associated with a that is returned by a - . - - - - - Returns the that created this handle. - - - - - Returns the which is associated with this handle. - - - - - Returns true if and only if the associated - with this handle has been expired. - - - - - Returns true if and only if the associated - with this handle has been canceled. - - - - - Attempts to cancel the associated with this handle. - If the task has been executed or canceled already, it will return with - no side effect. - - true if the cancellation completed successfully, otherwise false. - - - - Schedules s for one-time future execution in a background - thread. - - - - - Schedules the specified for one-time execution after the specified delay. - - a handle which is associated with the specified task - if this timer has been stopped already - if the pending timeouts are too many and creating new timeout - can cause instability in the system. - - - - Releases all resources acquired by this and cancels all - tasks which were scheduled but not executed yet. - - the handles associated with the tasks which were canceled by - this method - - - - A task which is executed after the delay specified with - . - - - - - Executed after the delay specified with - . - - a handle which is associated with this task - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. - - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. - - - - - Tries to call if the specified message implements - . - If the specified message doesn't implement , this method does nothing. - - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. - - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. - - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. - - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. Unlike , this - method catches an exception raised by and logs it, rather than - rethrowing it to the caller. It is usually recommended to use instead, unless - you absolutely need to swallow an exception. - - - - - Tries to call if the specified message implements - . If the specified message doesn't implement - , this method does nothing. Unlike , this - method catches an exception raised by and logs it, rather - than rethrowing it to the caller. It is usually recommended to use - instead, unless you absolutely need to swallow an exception. - - - - - Schedules the specified object to be released when the caller thread terminates. Note that this operation - is intended to simplify reference counting of ephemeral objects during unit tests. Do not use it beyond the - intended use case. - - - - - Schedules the specified object to be released when the caller thread terminates. Note that this operation - is intended to simplify reference counting of ephemeral objects during unit tests. Do not use it beyond the - intended use case. - - - - - String utility class. - - - - 2 - Quote character at beginning and end. - 5 - Extra allowance for anticipated escape characters that may be added. - - - - Converts the specified byte value into a 2-digit hexadecimal integer. - - - - - Converts the specified byte array into a hexadecimal value. - - - - - Converts the specified byte array into a hexadecimal value. - - - - - Converts the specified byte value into a hexadecimal integer. - - - - - The shortcut to SimpleClassName(o.GetType()). - - - - - The shortcut to SimpleClassName(o.GetType()). - - - - - Generates a simplified name from a . Similar to {@link Class#getSimpleName()}, but it works - fine - with anonymous classes. - - - - - Escapes the specified value, if necessary according to - RFC-4180. - - - The value which will be escaped according to - RFC-4180 - - - The value will first be trimmed of its optional white-space characters, according to - RFC-7230 - - the escaped value if necessary, or the value unchanged - - - - Time utility class. - - - - - Compare two timespan objects - - first timespan object - two timespan object - - - - Gets the system time. - - The system time. - -
-
+ + + + DotNetty.Common + + + + + Abstract base class for implementations + + + + Creates an instance of . + + + Creates an instance of . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Abstract base class for s that need to support scheduling. + + + + + Cancel all scheduled tasks + This method MUST be called only when is true. + + + + + Parent . + + + + + Returns true if the current belongs to this event loop, + false otherwise. + + + It is a convenient way to determine whether code can be executed directly or if it + should be posted for execution to this executor instance explicitly to ensure execution in the loop. + + + + + Returns true if the given belongs to this event loop, + false> otherwise. + + + + + Provides an access to a set of s it manages. + + + + + Returns list of owned event executors. + + + + + Returns true if and only if this executor is being shut down via . + + + + + Terminates this and all its s. + + for completion of termination. + + + + Terminates this and all its s. + + for completion of termination. + + + + A for completion of termination. . + + + + + Returns . + + + + + Executes the given task. + + Threading specifics are determined by IEventExecutor implementation. + + + + Executes the given action. + + + parameter is useful to when repeated execution of an action against + different objects is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Executes the given . + + Threading specifics are determined by IEventExecutor implementation. + + + + Executes the given action. + + + and parameters are useful when repeated execution of + an action against different objects in different context is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Returns true if this executor has been shut down, false otherwise. + + + + + Returns true if all tasks have completed following shut down. + + + Note that is never true unless was called first. + + + + + Executes the given function and returns indicating completion status and result of + execution. + + + Threading specifics are determined by IEventExecutor implementation. + + + + + Executes the given action and returns indicating completion status and result of execution. + + + Threading specifics are determined by IEventExecutor implementation. + + + + + Executes the given action and returns indicating completion status and result of execution. + + + parameter is useful to when repeated execution of an action against + different objects is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Executes the given action and returns indicating completion status and result of execution. + + + parameter is useful to when repeated execution of an action against + different objects is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Executes the given action and returns indicating completion status and result of execution. + + + and parameters are useful when repeated execution of + an action against different objects in different context is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Executes the given action and returns indicating completion status and result of execution. + + + and parameters are useful when repeated execution of + an action against different objects in different context is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Creates and executes a one-shot action that becomes enabled after the given delay. + + the task to execute + the time from now to delay execution + an representing pending completion of the task. + + + + Schedules the given action for execution after the specified delay would pass. + + + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + parameter is useful to when repeated execution of an action against + different objects is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + and parameters are useful when repeated execution of + an action against different objects in different context is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution at a fixed frequency after the specified delay would pass. + + + + + + + + + Schedules the given action for execution at a fixed frequency after the specified delay would pass. + + + + + + + + + Schedules the given action for execution at a fixed delay after the specified delay would pass. + + + + + + + + + Schedules the given action for execution at a fixed delay after the specified delay would pass. + + + + + + + + + Schedules the given action for execution after the specified delay would pass. + + + parameter is useful to when repeated execution of an action against + different objects is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + parameter is useful to when repeated execution of an action against + different objects is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + and parameters are useful when repeated execution of + an action against different objects in different context is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Schedules the given action for execution after the specified delay would pass. + + + and parameters are useful when repeated execution of + an action against different objects in different context is needed. + Threading specifics are determined by IEventExecutor implementation. + + + + + Reuse ReusableScheduledTask to optimize GC. + + + + + backed by a single thread. + + + + Creates a new instance of . + + + Creates a new instance of . + + + + Task Scheduler that will post work to this executor's queue. + + + + + Allows to track whether executor is progressing through its backlog. Useful for diagnosing / mitigating stalls due to blocking calls in conjunction with IsBacklogEmpty property. + + + + + Indicates whether executor's backlog is empty. Useful for diagnosing / mitigating stalls due to blocking calls in conjunction with Progress property. + + + + + Gets length of backlog of tasks queued for immediate execution. + + + + + + + + + + + + + + + + + + + + + + + Adds an which will be executed on shutdown of this instance. + + The to run on shutdown. + + + + Removes a previously added from the collection of s which will be + executed on shutdown of this instance. + + The to remove. + + + + + + + Removes all variables bound to the current thread. This operation is useful when you + are in a container environment, and you don't want to leave the thread local variables in the threads you do not + manage. + + + + + Destroys the data structure that keeps all variables accessed from + non-s. This operation is useful when you are in a container environment, and + you do not want to leave the thread local variables in the threads you do not manage. Call this method when + your application is being unloaded from the container. + + + + + Sets the value to uninitialized; a proceeding call to get() will trigger a call to GetInitialValue(). + + + + + + Returns the number of thread local variables bound to the current thread. + + + + + Gets or sets current value for the current thread. + + + + + Returns the current value for the specified thread local map. + The specified thread local map must be for the current thread. + + + + + Set the value for the specified thread local map. The specified thread local map must be for the current thread. + + + + + Returns true if and only if this thread-local variable is set. + + + + + Returns true if and only if this thread-local variable is set. + The specified thread local map must be for the current thread. + + + + + Returns the initial value for this thread-local variable. + + + + + Sets the value to uninitialized for the specified thread local map; + a proceeding call to will trigger a call to . + The specified thread local map must be for the current thread. + + + The from which this should be removed. + + + + + Invoked when this thread local variable is removed by . + + + + + The internal data structure that stores the thread-local variables for DotNetty and all + s. Note that this class is for internal use only and is subject to change at any + time. Use unless you know what you are doing. + + + + + Used by . + + + + + Sets a value at the given index in this . + + The desired index at which a value should be set. + The value to set at the given index. + true if and only if a new thread-local variable has been created. + + + + Resets the . Be aware this will only reset the current internal + position and not shrink the internal char array. + + + + + Create a new ascii string, this method assumes all chars has been sanitized to ascii chars when appending + to the array. + + + + Forked from + JCTools + . + A concurrent access enabling class used by circular array based queues this class exposes an offset computation + method along with differently memory fenced load/store methods into the underlying array. The class is pre-padded and + the array is padded on either side to help with False sharing prvention. It is expected theat subclasses handle post + padding. +

+ Offset calculation is separate from access to enable the reuse of a give compute offset. +

+ Load/Store methods using a + buffer + parameter are provided to allow the prevention of field reload after a + LoadLoad barrier. +

+ + +

+ Calculates an element offset based on a given array index. + + The desirable element index. + The offset in bytes within the array for a given index. +
+ + + A plain store (no ordering/fences) of an element to a given offset. + + Computed via . + A kitty. + + + + An ordered store(store + StoreStore barrier) of an element to a given offset. + + Computed via . + An orderly kitty. + + + + A plain load (no ordering/fences) of an element from a given offset. + + Computed via . + The element at the offset. + + + + A volatile load (load + LoadLoad barrier) of an element from a given offset. + + Computed via . + The element at the offset. + + + + A skeletal implementation of . This class implements + all methods that have a parameter by default to call + specific logger methods such as or . + + + + + Creates a new instance. + + A friendly name for the new logger instance. + + + + Holds the results of formatting done by . + + + + + Internal-use-only logger used by DotNetty. DO NOT + access this class outside of DotNetty. + + + + + Return the name of this instance. + + name of this logger instance + + + + Is this logger instance enabled for the TRACE level? + + true if this Logger is enabled for level TRACE, false otherwise. + + + + Log a message object at level TRACE. + + the message object to be logged + + + + Log a message at level TRACE according to the specified format and + argument. + + This form avoids superfluous object creation when the logger is disabled + for level TRACE. + + + the format string + the argument + + + + Log a message at level TRACE according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level TRACE. + + + the format string + the first argument + the second argument + + + + Log a message at level TRACE according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level TRACE. However, this variant incurs the hidden + (and relatively small) cost of creating an object[] + before invoking the method, + even if this logger is disabled for TRACE. The variants + and + arguments exist solely to avoid this hidden cost. + + + the format string + an array of arguments + + + + Log an exception at level TRACE with an accompanying message. + + the message accompanying the exception + the exception to log + + + + Log an exception at level TRACE. + + the exception to log + + + + Is this logger instance enabled for the DEBUG level? + + true if this Logger is enabled for level DEBUG, false otherwise. + + + + Log a message object at level DEBUG. + + the message object to be logged + + + + Log a message at level DEBUG according to the specified format and + argument. + + This form avoids superfluous object creation when the logger is disabled + for level DEBUG. + + + the format string + the argument + + + + Log a message at level DEBUG according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level DEBUG. + + + the format string + the first argument + the second argument + + + + Log a message at level DEBUG according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level DEBUG. However, this variant incurs the hidden + (and relatively small) cost of creating an object[] + before invoking the method, + even if this logger is disabled for DEBUG. The variants + and + arguments exist solely to avoid this hidden cost. + + + the format string + an array of arguments + + + + Log an exception at level DEBUG with an accompanying message. + + the message accompanying the exception + the exception to log + + + + Log an exception at level DEBUG. + + the exception to log + + + + Is this logger instance enabled for the INFO level? + + true if this Logger is enabled for level INFO, false otherwise. + + + + Log a message object at level INFO. + + the message object to be logged + + + + Log a message at level INFO according to the specified format and + argument. + + This form avoids superfluous object creation when the logger is disabled + for level INFO. + + + the format string + the argument + + + + Log a message at level INFO according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level INFO. + + + the format string + the first argument + the second argument + + + + Log a message at level INFO according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level INFO. However, this variant incurs the hidden + (and relatively small) cost of creating an object[] + before invoking the method, + even if this logger is disabled for INFO. The variants + and + arguments exist solely to avoid this hidden cost. + + + the format string + an array of arguments + + + + Log an exception at level INFO with an accompanying message. + + the message accompanying the exception + the exception to log + + + + Log an exception at level INFO. + + the exception to log + + + + Is this logger instance enabled for the WARN level? + + true if this Logger is enabled for level WARN, false otherwise. + + + + Log a message object at level WARN. + + the message object to be logged + + + + Log a message at level WARN according to the specified format and + argument. + + This form avoids superfluous object creation when the logger is disabled + for level WARN. + + + the format string + the argument + + + + Log a message at level WARN according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level WARN. However, this variant incurs the hidden + (and relatively small) cost of creating an object[] + before invoking the method, + even if this logger is disabled for WARN. The variants + and + arguments exist solely to avoid this hidden cost. + + + the format string + an array of arguments + + + + Log a message at level WARN according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level WARN. + + + the format string + the first argument + the second argument + + + + Log an exception at level WARN with an accompanying message. + + the message accompanying the exception + the exception to log + + + + Log an exception at level WARN. + + the exception to log + + + + Is this logger instance enabled for the ERROR level? + + true if this Logger is enabled for level ERROR, false otherwise. + + + + Log a message object at level ERROR. + + the message object to be logged + + + + Log a message at level ERROR according to the specified format and + argument. + + This form avoids superfluous object creation when the logger is disabled + for level ERROR. + + + the format string + the argument + + + + Log a message at level ERROR according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level ERROR. + + + the format string + the first argument + the second argument + + + + Log a message at level ERROR according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for level ERROR. However, this variant incurs the hidden + (and relatively small) cost of creating an object[] + before invoking the method, + even if this logger is disabled for ERROR. The variants + and + arguments exist solely to avoid this hidden cost. + + + the format string + an array of arguments + + + + Log an exception at level ERROR with an accompanying message. + + the message accompanying the exception + the exception to log + + + + Log an exception at level ERROR. + + the exception to log + + + + Is the logger instance enabled for the specified ? + + log level + true if this Logger is enabled for the specified , false otherwise. + + + + Log a message object at a specified . + + log level + the message object to be logged + + + + Log a message at a specified according to the specified format and + argument. + + This form avoids superfluous object creation when the logger is disabled + for the specified . + + + log level + the format string + the argument + + + + Log a message at a specified according to the specified format and + arguments. + + This form avoids superfluous object creation when the logger is disabled + for the specified . + + + log level + the format string + the first argument + the second argument + + + + Log a message at the specified according to the specified format + and arguments. + + This form avoids superfluous string concatenation when the logger + is disabled for the specified . However, this variant incurs the hidden + (and relatively small) cost of creating an object[] before invoking the method, + even if this logger is disabled for the specified . The variants + and + arguments exist solely + in order to avoid this hidden cost. + + + log level + the format string + an array of arguments + + + + Log an exception at the specified with an + accompanying message. + + log level + the message accompanying the exception + the exception to log + + + + Log an exception at the specified . + + log level + the exception to log + + + + Creates an or changes the default factory + implementation. This factory allows you to choose what logging framework + DotNetty should use. The default factory is own with registered. + You can change it to your preferred logging framework before other DotNetty classes are loaded: +
+                    InternalLoggerFactory.DefaultFactory = new LoggerFactory();
+                
+ Please note that the new default factory is effective only for the classes + which were loaded after the default factory is changed. Therefore, should be set as early + as possible and should not be called more than once. +
+
+ + + Creates a new logger instance with the name of the specified type. + + type where logger is used + logger instance + + + + Creates a new logger instance with the name of the specified type. + + type where logger is used + logger instance + + + + Creates a new logger instance with the specified name. + + logger name + logger instance + + + + The log level that can log at. + + + + + 'TRACE' log level. + + + + + 'DEBUG' log level. + + + + + 'INFO' log level. + + + + + 'WARN' log level. + + + + + 'ERROR' log level. + + + + + Formats messages according to very simple substitution rules. Substitutions can be made 1, 2 or more arguments. + For example, + + MessageFormatter.Format("Hi {}.", "there") + + + will return the string "Hi there.". + + + The {} pair is called the formatting anchor. It serves to designate the location where arguments need + to be substituted within the message pattern. + + + In case your message contains the '{' or the '}' character, you do not have to do anything special unless the + '}' character immediately follows '{'. For example, + + + MessageFormatter.Format("Set {1,2,3} is not equal to {}.", "1,2"); + + + will return the string "Set {1,2,3} is not equal to 1,2.". + + + If for whatever reason you need to place the string "{}" in the message without its formatting anchor + meaning, then you need to escape the '{' character with '\', that is the backslash character. Only the '{' + character should be escaped. There is no need to escape the '}' character. For example, + + + MessageFormatter.Format("Set \\{} is not equal to {}.", "1,2"); + + + will return the string "Set {} is not equal to 1,2.". + + + The escaping behavior just described can be overridden by escaping the escape character '\'. Calling + + + MessageFormatter.Format("File name is C:\\\\{}.", "file.zip"); + + + will return the string "File name is C:\file.zip". + + + + + + + + + Performs single argument substitution for the given . + + For example, + + + MessageFormatter.Format("Hi {}.", "there"); + + + will return the string "Hi there.". + + + The message pattern which will be parsed and formatted + The argument to be substituted in place of the formatting anchor + The formatted message + + + + Performs a two argument substitution for the given . + + For example, + + + MessageFormatter.Format("Hi {}. My name is {}.", "Alice", "Bob"); + + + will return the string "Hi Alice. My name is Bob.". + + + The message pattern which will be parsed and formatted + The argument to be substituted in place of the first formatting anchor + The argument to be substituted in place of the second formatting anchor + The formatted message + + + + Same principle as the and + methods, except that any number of arguments can be passed in an array. + + The message pattern which will be parsed and formatted + An array of arguments to be substituted in place of formatting anchors + The formatted message + + + Length of a valid MAC address. + + + Obtains the best MAC address found on local network interfaces. + Generally speaking, an active network interface used on public + networks is better than a local network interface. + byte array containing a MAC. null if no MAC can be found. + + + byte array of a MAC address. + hex formatted MAC address. + + + positive - current is better, 0 - cannot tell from MAC addr, negative - candidate is better. + + + positive - current is better, 0 - cannot tell, negative - candidate is better + + + + Forked from JCTools. + A Multi-Producer-Single-Consumer queue based on a . This implies + that any thread may call the Enqueue methods, but only a single thread may call poll/peek for correctness to + maintained. + + This implementation follows patterns documented on the package level for False Sharing protection. + + + This implementation is using the Fast Flow + method for polling from the queue (with minor change to correctly publish the index) and an extension of + the Leslie Lamport concurrent queue algorithm (originated by Martin Thompson) on the producer side. + + + The type of each item in the queue. + + + + Lock free Enqueue operation, using a single compare-and-swap. As the class name suggests, access is + permitted to many threads concurrently. + + The item to enqueue. + true if the item was added successfully, otherwise false. + + + + + A wait-free alternative to , which fails on compare-and-swap failure. + + The item to enqueue. + 1 if next element cannot be filled, -1 if CAS failed, and 0 if successful. + + + + Lock free poll using ordered loads/stores. As class name suggests, access is limited to a single thread. + + The dequeued item. + true if an item was retrieved, otherwise false. + + + + + Lock free peek using ordered loads. As class name suggests access is limited to a single thread. + + The peeked item. + true if an item was retrieved, otherwise false. + + + + + Returns the number of items in this . + + + + + A plain store (no ordering/fences) of an element to a given offset. + + The element type. + The source buffer. + Computed via + An orderly kitty. + + + + An ordered store(store + StoreStore barrier) of an element to a given offset. + + The element type. + The source buffer. + Computed via + + + + + A plain load (no ordering/fences) of an element from a given offset. + + The element type. + The source buffer. + Computed via + The element at the given in the given . + + + + A volatile load (load + LoadLoad barrier) of an element from a given offset. + + The element type. + The source buffer. + Computed via + The element at the given in the given . + + + + Gets the offset in bytes within the array for a given index. + + The desired element index. + Mask for the index. + The offset (in bytes) within the array for a given index. + + + + Called from a producer thread subject to the restrictions appropriate to the implementation and + according to the interface. + + The element to enqueue. + true if the element was inserted, false iff the queue is full. + + + + Called from the consumer thread subject to the restrictions appropriate to the implementation and + according to the interface. + + A message from the queue if one is available, null iff the queue is empty. + + + + Called from the consumer thread subject to the restrictions appropriate to the implementation and + according to the interface. + + A message from the queue if one is available, null iff the queue is empty. + + + + A collection of utility methods to retrieve and parse the values of the system properties (Environment variables). + + + + + Returns true if and only if the system property with the specified key + exists. + + + + + Returns the value of the system property with the specified + key, while falling back to null if the property access fails. + + the property value or null + + + + Returns the value of the system property with the specified + key, while falling back to the specified default value if + the property access fails. + + + the property value. + def if there's no such property or if an access to the + specified property is not allowed. + + + + + Returns the value of the system property with the specified + key, while falling back to the specified default value if + the property access fails. + + + the property value or def if there's no such property or + if an access to the specified property is not allowed. + + + + + Returns the value of the system property with the specified + key, while falling back to the specified default value if + the property access fails. + + + the property value. + def if there's no such property or if an access to the + specified property is not allowed. + + + + + Returns the value of the system property with the specified + key, while falling back to the specified default value if + the property access fails. + + + the property value. + def if there's no such property or if an access to the + specified property is not allowed. + + + + + Reference counting interface for reusable objects + + + + + Returns the reference count of this object + + + + + Increases the reference count by 1 + + + + + Increases the reference count by + + + + + Records the current access location of this object for debugging purposes. + If this object is determined to be leaked, the information recorded by this operation will be provided to you + via . This method is a shortcut to with null as + an argument. + + + + + + Records the current access location of this object with an additonal arbitrary information for debugging + purposes. If this object is determined to be leaked, the information recorded by this operation will be + provided to you via . + + + + + Decreases the reference count by 1 and deallocates this object if the reference count reaches 0. + + true if and only if the reference count is 0 and this object has been deallocated + + + + Decreases the reference count by and deallocates this object if the reference count + reaches 0. + + true if and only if the reference count is 0 and this object has been deallocated + + + + A hint object that provides human-readable message for easier resource leak tracking. + + + + + Returns a human-readable message that potentially enables easier resource leak tracking. + + + + + + Records the caller's current stack trace so that the can tell where the + leaked + resource was accessed lastly. This method is a shortcut to with null as an + argument. + + + + + Records the caller's current stack trace and the specified additional arbitrary information + so that the can tell where the leaked resource was accessed lastly. + + + + + + Close the leak so that does not warn about leaked resources. + + true if called first time, false if called already + + + + Represents the level of resource leak detection. + + + + + Disables resource leak detection. + + + + + Enables simplistic sampling resource leak detection which reports there is a leak or not, + at the cost of small overhead (default). + + + + + Enables advanced sampling resource leak detection which reports where the leaked object was accessed + recently at the cost of high overhead. + + + + + Enables paranoid resource leak detection which reports where the leaked object was accessed recently, + at the cost of the highest possible overhead (for testing purposes only). + + + + Returns true if resource leak detection is enabled. + + + + Gets or sets resource leak detection level + + + + + Creates a new which is expected to be closed + when the + related resource is deallocated. + + the or null + + + + Schedules the specified to run when the specified dies. + + + + + Cancels the task scheduled via . + + + + + Waits until the thread of this watcher has no threads to watch and terminates itself. + Because a new watcher thread will be started again on , + this operation is only useful when you want to ensure that the watcher thread is terminated + after your application is shut down and there's no chance of calling + afterwards. + + + true if and only if the watcher thread has been terminated. + + + + Allocate a new or return null if not possible. + + + + Base implementation of . + + + Creates a new instance. + + + + Extension methods used for slicing byte arrays + + + + + Merge the byte arrays into one byte array. + + + + + During normal use cases the AsciiString should be immutable, but if the + underlying array is shared, and changes then this needs to be called. + + + + + Implementation of the java.concurrent.util AtomicReference type. + + + + + Sets the initial value of this to . + + + + + Default constructor + + + + + The current value of this + + + + + If equals , then set the Value to + + Returns true if was set, false otherwise. + + + + + Implicit conversion operator = automatically casts the to an instance of + + + + + + Implicit conversion operator = allows us to cast any type directly into a + instance. + + + + + + + Key which can be used to access out of the . Be aware that + it is not be possible to have multiple keys with the same name. + + + the type of the which can be accessed via this . + + + + Returns the singleton instance of the {@link AttributeKey} which has the specified name. + + + Returns true if a exists for the given name. + + + + Creates a new for the given name or fail with an + if a for the given name exists. + + + + + Provides a mechanism to iterate over a collection of bytes. + + + + + Aborts on a NUL (0x00). + + + + + Aborts on a non-NUL (0x00). + + + + + Aborts on a CR ('\r'). + + + + + Aborts on a non-CR ('\r'). + + + + + Aborts on a LF ('\n'). + + + + + Aborts on a non-LF ('\n'). + + + + + Aborts on a CR (';'). + + + + + Aborts on a comma (','). + + + + + Aborts on a ascii space character (' '). + + + + + Aborts on a CR ('\r') or a LF ('\n'). + + + + + Aborts on a byte which is neither a CR ('\r') nor a LF ('\n'). + + + + + Aborts on a linear whitespace (a ' ' or a '\t'). + + + + + Aborts on a byte which is not a linear whitespace (neither ' ' nor '\t'). + + + + + A pool of s. + + + + Shortcut of this.ValueOf(firstNameComponent.Name + "#" + secondNameComponent). + + + + Returns the which is assigned to the specified name. + If there's no such , a new one will be created and returned. + Once created, the subsequent calls with the same name will always return the previously created one + (i.e. singleton.) + + the name of the + + + Returns true if a exists for the given name. + + + + Creates a new for the given name or fail with an + if a for the given name exists. + + + + + Default implementation which use simple synchronization per bucket to keep the memory + overhead + as low as possible. + + + + + Creates a new timer. + + the interval between two consecutive ticks + the size of the wheel + The maximum number of pending timeouts after which call to + newTimeout will result in being thrown. + No maximum pending timeouts limit is assumed if this value is 0 or negative. + if either of tickInterval and ticksPerWheel is <= 0 + + + + Starts the background thread explicitly. The background thread will + start automatically on demand even if you did not call this method. + + if this timer has been + stopped already. + + + + calculate timer firing time from startTime and current tick number, + then wait until that goal has been reached. + + long.MinValue if received a shutdown request, + current time otherwise (with long.MinValue changed by +1) + + + + + Bucket that stores HashedWheelTimeouts. These are stored in a linked-list like datastructure to allow easy + removal of HashedWheelTimeouts in the middle. Also the HashedWheelTimeout act as nodes themself and so no + extra object creation is needed. + + + + + Add a to this bucket. + + + + + Expire all s for the given deadline. + + + + + Clear this bucket and return all not expired / cancelled s. + + + + An attribute which allows to store a value reference. It may be updated atomically and so is thread-safe. + the type of the value it holds. + + + + Returns the key of this attribute. + + + + + Returns the current value, which may be null + + + + + Sets the value + + + + + Atomically sets to the given value and returns the old value which may be null if non was set before. + + + + + Atomically sets to the given value if this 's value is null. + If it was not possible to set the value as it contains a value it will just return the current value. + + + + + Removes this attribute from the and returns the old value. Subsequent + + calls will return null. + If you only want to return the old value and clear the while still keep it in + use with a value of null. + + + + + Atomically sets the value to the given updated value if the current value == the expected value. + If it the set was successful it returns true otherwise false. + + + + + Removes this attribute from the . Subsequent calls will return + null. + If you only want to remove the value and clear the while still keep it in + use with a value of null. + + + + Holds s which can be accessed via . + Implementations must be Thread-safe. + + + + Get the for the given . This method will never return + null, but may return an which does not have a value set yet. + + + + + Returns true if and only if the given exists in this + . + + + + Start is the inclusive start index to begin the subsequence. + End is the exclusive end index to end the subsequence. + + + + A singleton which is safe to compare via the == operator. Created and managed by + . + + + + Returns the unique number assigned to this . + + + Returns the name of this . + + + + + Exception thrown during instances where a reference count is used incorrectly + + + + + A handle associated with a that is returned by a + . + + + + + Returns the that created this handle. + + + + + Returns the which is associated with this handle. + + + + + Returns true if and only if the associated + with this handle has been expired. + + + + + Returns true if and only if the associated + with this handle has been canceled. + + + + + Attempts to cancel the associated with this handle. + If the task has been executed or canceled already, it will return with + no side effect. + + true if the cancellation completed successfully, otherwise false. + + + + Schedules s for one-time future execution in a background + thread. + + + + + Schedules the specified for one-time execution after the specified delay. + + a handle which is associated with the specified task + if this timer has been stopped already + if the pending timeouts are too many and creating new timeout + can cause instability in the system. + + + + Releases all resources acquired by this and cancels all + tasks which were scheduled but not executed yet. + + the handles associated with the tasks which were canceled by + this method + + + + A task which is executed after the delay specified with + . + + + + + Executed after the delay specified with + . + + a handle which is associated with this task + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. + + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. + + + + + Tries to call if the specified message implements + . + If the specified message doesn't implement , this method does nothing. + + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. + + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. + + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. + + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. Unlike , this + method catches an exception raised by and logs it, rather than + rethrowing it to the caller. It is usually recommended to use instead, unless + you absolutely need to swallow an exception. + + + + + Tries to call if the specified message implements + . If the specified message doesn't implement + , this method does nothing. Unlike , this + method catches an exception raised by and logs it, rather + than rethrowing it to the caller. It is usually recommended to use + instead, unless you absolutely need to swallow an exception. + + + + + Schedules the specified object to be released when the caller thread terminates. Note that this operation + is intended to simplify reference counting of ephemeral objects during unit tests. Do not use it beyond the + intended use case. + + + + + Schedules the specified object to be released when the caller thread terminates. Note that this operation + is intended to simplify reference counting of ephemeral objects during unit tests. Do not use it beyond the + intended use case. + + + + + String utility class. + + + + 2 - Quote character at beginning and end. + 5 - Extra allowance for anticipated escape characters that may be added. + + + + Converts the specified byte value into a 2-digit hexadecimal integer. + + + + + Converts the specified byte array into a hexadecimal value. + + + + + Converts the specified byte array into a hexadecimal value. + + + + + Converts the specified byte value into a hexadecimal integer. + + + + + The shortcut to SimpleClassName(o.GetType()). + + + + + The shortcut to SimpleClassName(o.GetType()). + + + + + Generates a simplified name from a . Similar to {@link Class#getSimpleName()}, but it works + fine + with anonymous classes. + + + + + Escapes the specified value, if necessary according to + RFC-4180. + + + The value which will be escaped according to + RFC-4180 + + + The value will first be trimmed of its optional white-space characters, according to + RFC-7230 + + the escaped value if necessary, or the value unchanged + + + + Time utility class. + + + + + Compare two timespan objects + + first timespan object + two timespan object + + + + Gets the system time. + + The system time. + +
+
diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml.meta index dc4e997..5fb569f 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Common.xml.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: c546fed3667084e4aaa511b1588f700f -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: c546fed3667084e4aaa511b1588f700f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.mdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.mdb.meta index 2b06c55..7df5ba0 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.mdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.mdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 39f9688dda8becc44b61267395d5e74b -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 39f9688dda8becc44b61267395d5e74b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.meta index 1113d4c..9b75c40 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: a0061affda6d09a429fd2674e5c26df4 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: a0061affda6d09a429fd2674e5c26df4 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.pdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.pdb.meta index c3de5e6..49a4aee 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.pdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.pdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: e52783c20d361e14287f5ac05e933943 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: e52783c20d361e14287f5ac05e933943 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml index 3172afe..77634a5 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml @@ -1,591 +1,591 @@ - - - - DotNetty.Handlers - - - - The {@link FlowControlHandler} ensures that only one message per {@code read()} is sent downstream. - - Classes such as {@link ByteToMessageDecoder} or {@link MessageToByteEncoder} are free to emit as - many events as they like for any given input. A channel's auto reading configuration doesn't usually - apply in these scenarios. This is causing problems in downstream {@link ChannelHandler}s that would - like to hold subsequent events while they're processing one event. It's a common problem with the - {@code HttpObjectDecoder} that will very often fire a {@code HttpRequest} that is immediately followed - by a {@code LastHttpContent} event. - -
{@code
-             ChannelPipeline pipeline = ...;
-            
-             pipeline.addLast(new HttpServerCodec());
-             pipeline.addLast(new FlowControlHandler());
-            
-             pipeline.addLast(new MyExampleHandler());
-            
-             class MyExampleHandler extends ChannelInboundHandlerAdapter {
-               @Override
-               public void channelRead(IChannelHandlerContext ctx, Object msg) {
-                 if (msg instanceof HttpRequest) {
-                   ctx.channel().config().setAutoRead(false);
-            
-                   // The FlowControlHandler will hold any subsequent events that
-                   // were emitted by HttpObjectDecoder until auto reading is turned
-                   // back on or Channel#read() is being called.
-                 }
-               }
-             }
-             }
- - @see ChannelConfig#setAutoRead(bool) -
- - Determine if the underlying {@link Queue} is empty. This method exists for - testing, debugging and inspection purposes and it is not Thread safe! - - - Releases all messages and destroys the {@link Queue}. - - - Dequeues one or many (or none) messages depending on the channel's auto - reading state and returns the number of messages that were consumed from - the internal queue. - - The {@code minConsume} argument is used to force {@code dequeue()} into - consuming that number of messages regardless of the channel's auto - reading configuration. - - @see #read(ChannelHandlerContext) - @see #channelRead(ChannelHandlerContext, Object) - - - - A that logs all events using a logging framework. - By default, all events are logged at DEBUG level. - - - - - Creates a new instance whose logger name is the fully qualified class - name of the instance with hex dump enabled. - - - - - Creates a new instance whose logger name is the fully qualified class - name of the instance - - the log level - - - - Creates a new instance with the specified logger name and with hex dump - enabled - - the class type to generate the logger for - - - - Creates a new instance with the specified logger name. - - the class type to generate the logger for - the log level - - - - Creates a new instance with the specified logger name using the default log level. - - the name of the class to use for the logger - - - - Creates a new instance with the specified logger name. - - the name of the class to use for the logger - the log level - - - - Returns the that this handler uses to log - - - - - Formats an event and returns the formatted message - - the name of the event - - - - Formats an event and returns the formatted message. - - the name of the event - the argument of the event - - - - Formats an event and returns the formatted message. This method is currently only used for formatting - - - the name of the event - the first argument of the event - the second argument of the event - - - - Generates the default log message of the specified event whose argument is a . - - - - - Generates the default log message of the specified event whose argument is a . - - - - - Generates the default log message of the specified event whose argument is an arbitrary object. - - - - - An that represents the idle state of a . - - - - - No data was received for a while. - - - - - No data was sent for a while. - - - - - No data was either received or sent for a while. - - - - - A user event triggered by when a is idle. - - - - - Constructor for sub-classes. - - the which triggered the event. - true if its the first idle event for the . - - - - Returns the idle state. - - The state. - - - - Returns true if this was the first event for the - - true if first; otherwise, false. - - - - Triggers an when a has not performed - read, write, or both operation for a while. - - - -

Supported idle states

- - - - - - - - - - - - - - - - -
PropertyMeaning
readerIdleTimean whose state is - will be triggered when no read was performed for the specified period of - time. Specify 0 to disable. -
writerIdleTimean whose state is - will be triggered when no write was performed for the specified period of - time. Specify 0 to disable.
allIdleTimean whose state is - will be triggered when neither read nor write was performed for the - specified period of time. Specify 0 to disable.
-
- - - - - - An example that sends a ping message when there is no outbound traffic - for 30 seconds. The connection is closed when there is no inbound traffic - for 60 seconds. - - - var bootstrap = new (); - - bootstrap.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel => - { - IChannelPipeline pipeline = channel.Pipeline; - - pipeline.AddLast("idleStateHandler", new (60, 30, 0); - pipeline.AddLast("myHandler", new MyHandler()); - } - - - Handler should handle the triggered by . - - - public class MyHandler : ChannelDuplexHandler - { - public override void UserEventTriggered( context, evt) - { - if(evt is ) - { - e = () evt; - if (e.State == .ReaderIdle) - { - ctx.close(); - } - else if(e.State == .WriterIdle) - { - ctx.writeAndFlush(new PingMessage()); - } - } - } - } - - - - - - -
-
- - - Initializes a new instance firing s. - - - an whose state is - will be triggered when no read was performed for the specified - period of time. Specify 0 to disable. - - - an whose state is - will be triggered when no write was performed for the specified - period of time. Specify 0 to disable. - - - an whose state is - will be triggered when neither read nor write was performed for - the specified period of time. Specify 0 to disable. - - - - - - - - - - Initializes a new instance firing s. - - - whether or not the consumption of bytes should be taken into - consideration when assessing write idleness. The default is false. - - - an whose state is - will be triggered when no read was performed for the specified - period of time. Specify to disable. - - - an whose state is - will be triggered when no write was performed for the specified - period of time. Specify to disable. - - - an whose state is - will be triggered when neither read nor write was performed for - the specified period of time. Specify to disable. - - - - - Return the readerIdleTime that was given when instance this class in milliseconds. - - The reader idle time in millis. - - - - Return the writerIdleTime that was given when instance this class in milliseconds. - - The writer idle time in millis. - - - - Return the allIdleTime that was given when instance this class in milliseconds. - - The all idle time in millis. - - - - This method is visible for testing! - - - - - - This method is visible for testing! - - - - - - - - - - - Is called when an should be fired. This implementation calls - . - - Context. - Evt. - - - - Returns a . - - - - - - - - - - - - - - Returns true if and only if the - was constructed - with observeOutput enabled and there has been an observed change in the - between two consecutive calls of this method. - https://github.com/netty/netty/issues/6150 - - - - - - - - Raises a when no data was read within a certain - period of time. - -
-             The connection is closed when there is no inbound traffic
-             for 30 seconds.
-            
-             
-             
-             var bootstrap = new ();
-            
-             bootstrap.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel =>
-             {
-                 IChannelPipeline pipeline = channel.Pipeline;
-                 
-                 pipeline.AddLast("readTimeoutHandler", new (30);
-                 pipeline.AddLast("myHandler", new MyHandler());
-             } 
-             
-                        
-             
-             public class MyHandler : ChannelDuplexHandler 
-             {
-                 public override void ExceptionCaught( context,  exception)
-                 {
-                     if(exception is ) 
-                     {
-                         // do somethind
-                     }
-                     else
-                     {
-                         base.ExceptionCaught(context, cause);
-                     }
-                  }
-             }
-             
-             
-             
- - - -
-
- - - Initializes a new instance of the class. - - Timeout in seconds. - - - - Initializes a new instance of the class. - - Timeout. - - - - Is called when a read timeout was detected. - - Context. - - - - Raises a when a write operation cannot finish in a certain period of time. - - - - - The connection is closed when a write operation cannot finish in 30 seconds. - - - var bootstrap = new (); - - bootstrap.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel => - { - IChannelPipeline pipeline = channel.Pipeline; - - pipeline.AddLast("writeTimeoutHandler", new (30); - pipeline.AddLast("myHandler", new MyHandler()); - } - - - - public class MyHandler : ChannelDuplexHandler - { - public override void ExceptionCaught( context, exception) - { - if(exception is ) - { - // do somethind - } - else - { - base.ExceptionCaught(context, cause); - } - } - } - - - - - - - - - - - A doubly-linked list to track all WriteTimeoutTasks. - - - - - Initializes a new instance of the class. - - Timeout in seconds. - - - - Initializes a new instance of the class. - - Timeout. - - - - Is called when a write timeout was detected - - Context. - - - - Special exception which will get thrown if a packet is - received that not looks like a TLS/SSL record. A user can check for - this and so detect if one peer tries to - use secure and the other plain connection. - - - - Unwraps inbound SSL records. - - - - Creates a new event that indicates a successful handshake. - - - - - Creates a new event that indicates an unsuccessful handshake. - Use {@link #SUCCESS} to indicate a successful handshake. - - - - - Return {@code true} if the handshake was successful - - - - - Return the {@link Throwable} if {@link #isSuccess()} returns {@code false} - and so the handshake failed. - - - - Utilities for TLS packets. - - - change cipher spec - - - alert - - - handshake - - - application data - - - the length of the ssl record header (in bytes) - - - - Return how much bytes can be read out of the encrypted data. Be aware that this method will not increase - the readerIndex of the given . - - - The to read from. Be aware that it must have at least - bytes to read, - otherwise it will throw an . - - Offset to record start. - - The length of the encrypted packet that is included in the buffer. This will - return -1 if the given is not encrypted at all. - - -
-
+ + + + DotNetty.Handlers + + + + The {@link FlowControlHandler} ensures that only one message per {@code read()} is sent downstream. + + Classes such as {@link ByteToMessageDecoder} or {@link MessageToByteEncoder} are free to emit as + many events as they like for any given input. A channel's auto reading configuration doesn't usually + apply in these scenarios. This is causing problems in downstream {@link ChannelHandler}s that would + like to hold subsequent events while they're processing one event. It's a common problem with the + {@code HttpObjectDecoder} that will very often fire a {@code HttpRequest} that is immediately followed + by a {@code LastHttpContent} event. + +
{@code
+             ChannelPipeline pipeline = ...;
+            
+             pipeline.addLast(new HttpServerCodec());
+             pipeline.addLast(new FlowControlHandler());
+            
+             pipeline.addLast(new MyExampleHandler());
+            
+             class MyExampleHandler extends ChannelInboundHandlerAdapter {
+               @Override
+               public void channelRead(IChannelHandlerContext ctx, Object msg) {
+                 if (msg instanceof HttpRequest) {
+                   ctx.channel().config().setAutoRead(false);
+            
+                   // The FlowControlHandler will hold any subsequent events that
+                   // were emitted by HttpObjectDecoder until auto reading is turned
+                   // back on or Channel#read() is being called.
+                 }
+               }
+             }
+             }
+ + @see ChannelConfig#setAutoRead(bool) +
+ + Determine if the underlying {@link Queue} is empty. This method exists for + testing, debugging and inspection purposes and it is not Thread safe! + + + Releases all messages and destroys the {@link Queue}. + + + Dequeues one or many (or none) messages depending on the channel's auto + reading state and returns the number of messages that were consumed from + the internal queue. + + The {@code minConsume} argument is used to force {@code dequeue()} into + consuming that number of messages regardless of the channel's auto + reading configuration. + + @see #read(ChannelHandlerContext) + @see #channelRead(ChannelHandlerContext, Object) + + + + A that logs all events using a logging framework. + By default, all events are logged at DEBUG level. + + + + + Creates a new instance whose logger name is the fully qualified class + name of the instance with hex dump enabled. + + + + + Creates a new instance whose logger name is the fully qualified class + name of the instance + + the log level + + + + Creates a new instance with the specified logger name and with hex dump + enabled + + the class type to generate the logger for + + + + Creates a new instance with the specified logger name. + + the class type to generate the logger for + the log level + + + + Creates a new instance with the specified logger name using the default log level. + + the name of the class to use for the logger + + + + Creates a new instance with the specified logger name. + + the name of the class to use for the logger + the log level + + + + Returns the that this handler uses to log + + + + + Formats an event and returns the formatted message + + the name of the event + + + + Formats an event and returns the formatted message. + + the name of the event + the argument of the event + + + + Formats an event and returns the formatted message. This method is currently only used for formatting + + + the name of the event + the first argument of the event + the second argument of the event + + + + Generates the default log message of the specified event whose argument is a . + + + + + Generates the default log message of the specified event whose argument is a . + + + + + Generates the default log message of the specified event whose argument is an arbitrary object. + + + + + An that represents the idle state of a . + + + + + No data was received for a while. + + + + + No data was sent for a while. + + + + + No data was either received or sent for a while. + + + + + A user event triggered by when a is idle. + + + + + Constructor for sub-classes. + + the which triggered the event. + true if its the first idle event for the . + + + + Returns the idle state. + + The state. + + + + Returns true if this was the first event for the + + true if first; otherwise, false. + + + + Triggers an when a has not performed + read, write, or both operation for a while. + + + +

Supported idle states

+ + + + + + + + + + + + + + + + +
PropertyMeaning
readerIdleTimean whose state is + will be triggered when no read was performed for the specified period of + time. Specify 0 to disable. +
writerIdleTimean whose state is + will be triggered when no write was performed for the specified period of + time. Specify 0 to disable.
allIdleTimean whose state is + will be triggered when neither read nor write was performed for the + specified period of time. Specify 0 to disable.
+
+ + + + + + An example that sends a ping message when there is no outbound traffic + for 30 seconds. The connection is closed when there is no inbound traffic + for 60 seconds. + + + var bootstrap = new (); + + bootstrap.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel => + { + IChannelPipeline pipeline = channel.Pipeline; + + pipeline.AddLast("idleStateHandler", new (60, 30, 0); + pipeline.AddLast("myHandler", new MyHandler()); + } + + + Handler should handle the triggered by . + + + public class MyHandler : ChannelDuplexHandler + { + public override void UserEventTriggered( context, evt) + { + if(evt is ) + { + e = () evt; + if (e.State == .ReaderIdle) + { + ctx.close(); + } + else if(e.State == .WriterIdle) + { + ctx.writeAndFlush(new PingMessage()); + } + } + } + } + + + + + + +
+
+ + + Initializes a new instance firing s. + + + an whose state is + will be triggered when no read was performed for the specified + period of time. Specify 0 to disable. + + + an whose state is + will be triggered when no write was performed for the specified + period of time. Specify 0 to disable. + + + an whose state is + will be triggered when neither read nor write was performed for + the specified period of time. Specify 0 to disable. + + + + + + + + + + Initializes a new instance firing s. + + + whether or not the consumption of bytes should be taken into + consideration when assessing write idleness. The default is false. + + + an whose state is + will be triggered when no read was performed for the specified + period of time. Specify to disable. + + + an whose state is + will be triggered when no write was performed for the specified + period of time. Specify to disable. + + + an whose state is + will be triggered when neither read nor write was performed for + the specified period of time. Specify to disable. + + + + + Return the readerIdleTime that was given when instance this class in milliseconds. + + The reader idle time in millis. + + + + Return the writerIdleTime that was given when instance this class in milliseconds. + + The writer idle time in millis. + + + + Return the allIdleTime that was given when instance this class in milliseconds. + + The all idle time in millis. + + + + This method is visible for testing! + + + + + + This method is visible for testing! + + + + + + + + + + + Is called when an should be fired. This implementation calls + . + + Context. + Evt. + + + + Returns a . + + + + + + + + + + + + + + Returns true if and only if the + was constructed + with observeOutput enabled and there has been an observed change in the + between two consecutive calls of this method. + https://github.com/netty/netty/issues/6150 + + + + + + + + Raises a when no data was read within a certain + period of time. + +
+             The connection is closed when there is no inbound traffic
+             for 30 seconds.
+            
+             
+             
+             var bootstrap = new ();
+            
+             bootstrap.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel =>
+             {
+                 IChannelPipeline pipeline = channel.Pipeline;
+                 
+                 pipeline.AddLast("readTimeoutHandler", new (30);
+                 pipeline.AddLast("myHandler", new MyHandler());
+             } 
+             
+                        
+             
+             public class MyHandler : ChannelDuplexHandler 
+             {
+                 public override void ExceptionCaught( context,  exception)
+                 {
+                     if(exception is ) 
+                     {
+                         // do somethind
+                     }
+                     else
+                     {
+                         base.ExceptionCaught(context, cause);
+                     }
+                  }
+             }
+             
+             
+             
+ + + +
+
+ + + Initializes a new instance of the class. + + Timeout in seconds. + + + + Initializes a new instance of the class. + + Timeout. + + + + Is called when a read timeout was detected. + + Context. + + + + Raises a when a write operation cannot finish in a certain period of time. + + + + + The connection is closed when a write operation cannot finish in 30 seconds. + + + var bootstrap = new (); + + bootstrap.ChildHandler(new ActionChannelInitializer<ISocketChannel>(channel => + { + IChannelPipeline pipeline = channel.Pipeline; + + pipeline.AddLast("writeTimeoutHandler", new (30); + pipeline.AddLast("myHandler", new MyHandler()); + } + + + + public class MyHandler : ChannelDuplexHandler + { + public override void ExceptionCaught( context, exception) + { + if(exception is ) + { + // do somethind + } + else + { + base.ExceptionCaught(context, cause); + } + } + } + + + + + + + + + + + A doubly-linked list to track all WriteTimeoutTasks. + + + + + Initializes a new instance of the class. + + Timeout in seconds. + + + + Initializes a new instance of the class. + + Timeout. + + + + Is called when a write timeout was detected + + Context. + + + + Special exception which will get thrown if a packet is + received that not looks like a TLS/SSL record. A user can check for + this and so detect if one peer tries to + use secure and the other plain connection. + + + + Unwraps inbound SSL records. + + + + Creates a new event that indicates a successful handshake. + + + + + Creates a new event that indicates an unsuccessful handshake. + Use {@link #SUCCESS} to indicate a successful handshake. + + + + + Return {@code true} if the handshake was successful + + + + + Return the {@link Throwable} if {@link #isSuccess()} returns {@code false} + and so the handshake failed. + + + + Utilities for TLS packets. + + + change cipher spec + + + alert + + + handshake + + + application data + + + the length of the ssl record header (in bytes) + + + + Return how much bytes can be read out of the encrypted data. Be aware that this method will not increase + the readerIndex of the given . + + + The to read from. Be aware that it must have at least + bytes to read, + otherwise it will throw an . + + Offset to record start. + + The length of the encrypted packet that is included in the buffer. This will + return -1 if the given is not encrypted at all. + + +
+
diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml.meta index 9e0bfdd..72350d6 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Handlers.xml.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 89c10de1e938af64ca52675754efe833 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 89c10de1e938af64ca52675754efe833 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll index 29692d7..21fd3c9 100644 Binary files a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll and b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll differ diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.mdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.mdb.meta index be095f3..b885d8b 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.mdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.mdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: ecf53dc58e4338e4bb4a383e7499c042 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: ecf53dc58e4338e4bb4a383e7499c042 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.meta index 374256e..a00fec2 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: 2cba5dfccbc5e7c45bf31c4e226fc3aa -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 2cba5dfccbc5e7c45bf31c4e226fc3aa +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb index 544c837..fb847bb 100644 Binary files a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb and b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb differ diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb.meta index be226ca..a1a09bf 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.pdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 92f1af146f5fa4d41b064e7023dbea80 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 92f1af146f5fa4d41b064e7023dbea80 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml index 2a82cbd..3969613 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml @@ -1,2464 +1,2464 @@ - - - - DotNetty.Transport - - - - - This is a helper class that makes it easy to bootstrap an . It supports method- - chaining to provide an easy way to configure the . - - When not used in a context, the methods - are useful for connectionless transports such as datagram (UDP). - - - - - Specifies the which will handle events for the being built. - - The which is used to handle all the events for the to-be-created . - The instance. - - - - Specifies the of which will be created. - - The which is used to create instances from. - The instance. - - - - Assigns the which is used to bind the local "end" to. - - The instance to bind the local "end" to. - The instance. - - - - Assigns the local which is used to bind the local "end" to. - This overload binds to a for any IP address on the local machine, given a specific port. - - The port to bind the local "end" to. - The instance. - - - - Assigns the local which is used to bind the local "end" to. - This overload binds to a for a given hostname and port. - - The hostname to bind the local "end" to. - The port to bind the local "end" to. - The instance. - - - - Assigns the local which is used to bind the local "end" to. - This overload binds to a for a given and port. - - The to bind the local "end" to. - The port to bind the local "end" to. - The instance. - - - - Allows the specification of a which is used for the - instances once they get created. Use a value of null to remove - a previously set . - - The to configure. - The value to set the given option. - - - - Allows specification of an initial attribute of the newly created . If the value is - null, the attribute of the specified key is removed. - - - - - Validates all the parameters. Sub-classes may override this, but should call the super method in that case. - - - - - Returns a deep clone of this bootstrap which has the identical configuration. This method is useful when making - multiple s with similar settings. Please note that this method does not clone the - deeply but shallowly, making the group a shared resource. - - - - - Creates a new and registers it with an . - - - - - Creates a new and binds it to the endpoint specified via the methods. - - The bound . - - - - Creates a new and binds it. - This overload binds to a for any IP address on the local machine, given a specific port. - - The port to bind the local "end" to. - The bound . - - - - Creates a new and binds it. - This overload binds to a for a given hostname and port. - - The hostname to bind the local "end" to. - The port to bind the local "end" to. - The bound . - - - - Creates a new and binds it. - This overload binds to a for a given and port. - - The to bind the local "end" to. - The port to bind the local "end" to. - The bound . - - - - Creates a new and binds it. - - The instance to bind the local "end" to. - The bound . - - - - Specifies the to use for serving the requests. - - The to use for serving requests. - The instance. - - - - Returns the configured or null if none is configured yet. - - - - - A that makes it easy to bootstrap an to use for clients. - - The methods are useful - in combination with connectionless transports such as datagram (UDP). For regular TCP connections, - please use the provided methods. - - - - - Sets the which will resolve the address of the unresolved named address. - - The which will resolve the address of the unresolved named address. - The instance. - - - - Assigns the remote to connect to once the method is called. - - The remote to connect to. - The instance. - - - - Assigns the remote to connect to once the method is called. - - The hostname of the endpoint to connect to. - The port at the remote host to connect to. - The instance. - - - - Assigns the remote to connect to once the method is called. - - The of the endpoint to connect to. - The port at the remote host to connect to. - The instance. - - - - Connects an to the remote peer. - - The . - - - - Connects an to the remote peer. - - The hostname of the endpoint to connect to. - The port at the remote host to connect to. - The . - - - - Connects an to the remote peer. - - The of the endpoint to connect to. - The port at the remote host to connect to. - The . - - - - Connects an to the remote peer. - - The remote to connect to. - The . - - - - Connects an to the remote peer. - - The remote to connect to. - The local to connect to. - The . - - - - Performs DNS resolution for the remote endpoint and connects to it. - - The remote to connect to. - The local to connect the remote to. - The . - - - - Returns a deep clone of this bootstrap which has the identical configuration except that it uses - the given . This method is useful when making multiple s with similar - settings. - - - - - A sub-class which allows easy bootstrapping of . - - - - - Specifies the which is used for the parent (acceptor) and the child (client). - - - - - Sets the for the parent (acceptor) and the child (client). These - 's are used to handle all the events and IO for - and 's. - - - - - Allows specification of a which is used for the - instances once they get created (after the acceptor accepted the ). Use a - value of null to remove a previously set . - - - - - Sets the specific with the given value on every child . - If the value is null, the is removed. - - - - - Sets the which is used to serve the request for the 's. - - - - - Returns the configured which will be used for the child channels or null - if none is configured yet. - - - - Cache for the string representation of this channel - - - - Creates a new instance. - - The parent of this channel. Pass null if there's no parent. - - - - Creates a new instance. - - The parent of this channel. Pass null if there's no parent. - An for the new channel. - - - - Resets the stored . - - - - - Returns a new instance. Subclasses may override this method to assign custom - s to s that use the constructor. - - A new instance. - - - Returns a new pipeline instance. - - - - Create a new instance which will be used for the life-time of the - - - - - - Returns the ID of this channel. - - - - - Returns true if and only if the specified object is identical - with this channel (i.e. this == o). - - - - - Returns the string representation of this channel. The returned string contains a hex dump of the - , the , and the of this - channel for easier identification. - - - - - implementation which sub-classes must extend and use. - - - - true if the channel has never been registered, false otherwise /// - - - - This method must NEVER be called directly, but be executed as an - extra task with a clean call stack instead. The reason for this - is that this method calls - directly, which might lead to an unfortunate nesting of independent inbound/outbound - events. See the comments input for more details. - - - - - Prepares to close the . If this method returns an , the - caller must call the method with a task that calls - on the returned . If this method returns null, - must be called from the caller thread. (i.e. ) - - - - - Checks whether a given is compatible with the . - - The to check compatibility. - - true if the given is compatible with this - instance, otherwise false. - - - - - Is called after the is registered with its as part of the - register process. Sub-classes may override this method. - - - - - Binds the to the . - - The to bind. - - - - Disconnects this from its remote peer. - - - - - Closes the . - - - - - Deregisters the from its . Sub-classes may override this - method. - - - - - ScheduleAsync a read operation. - - - - - Flush the content of the given buffer to the remote peer. - - - - - Invoked when a new message is added to a of this - , so that the implementation converts the message to - another. (e.g. heap buffer -> direct buffer). - - The message to be filtered. - The filtered message. - - - Neither nor was called. - - - was called. - - - was called. - - - - Makes best possible effort to detect if was - called - yet. If not return false and if called or could not detect return true. - If this method returns true we will not invoke the but just forward the - event. - This is needed as may already put the in the - linked-list - but not called - - - - - A skeletal server-side implementation. A server-side does not - allow the following operations: , - , , - . - - - - - Creates a new instance. - - - - - The that automatically increases and - decreases the predicted buffer size on feed back. -

- It gradually increases the expected number of readable bytes if the previous - read fully filled the allocated buffer. It gradually decreases the expected - number of readable bytes if the read operation was not able to fill a certain - amount of the allocated buffer two times consecutively. Otherwise, it keeps - returning the same prediction. -

-
- - - Creates a new predictor with the default parameters. With the default - parameters, the expected buffer size starts from 1024, does not - go down below 64, and does not go up above 65536. - - - - Creates a new predictor with the specified parameters. - the inclusive lower bound of the expected buffer size - the initial buffer size when no feed back was received - the inclusive upper bound of the expected buffer size - - - - that works as a wrapper for another providing affinity on call. - - - - - - - - Creates a new instance of . - - serving as an actual provider of s. - - - - If running in a context of an existing , this is returned. - Otherwise, is retrieved from underlying . - - - - - - - - A queue of write operations which are pending for later execution. It also updates the - writability of the associated , so that - the pending write operations are also considered to determine the writability. - - - - Returns true if there are no pending write operations left in this queue. - - - Returns the number of pending write operations. - - - Add the given msg and returns for completion of processing msg. - - - - Remove all pending write operation and fail them with the given . The messages will be - released - via . - - - - - Remove a pending write operation and fail it with the given . The message will be released - via - . - - - - - Remove all pending write operation and performs them via - . - - - if something was written and null if the - is empty. - - - - - Removes a pending write operation and performs it via - . - - - if something was written and null if the - is empty. - - - - - Removes a pending write operation and release it's message via . - - of the pending write or null if the queue is empty. - - - - Return the current message or null if empty. - - - - Holds all meta-data and construct the linked-list structure. - - - - It is a good starting point if your implementation needs to intercept operations and also - state updates. - - - - - A special which offers an easy way to initialize a once it was - registered to its . - - Implementations are most often used in the context of - and to setup the of a . - - Be aware that this class is marked as Sharable (via ) and so the implementation must be safe to be re-used. - - - - public class MyChannelInitializer extends { - public void InitChannel( channel) { - channel.Pipeline().AddLast("myHandler", new MyHandler()); - } - } - bootstrap = ...; - ... - bootstrap.childHandler(new MyChannelInitializer()); - ... - - - A sub-type of . - - - - This method will be called once the was registered. After the method returns this instance - will be removed from the of the . - - The which was registered. - - - Represents the properties of a implementation. - - - Create a new instance - - true if and only if the channel has the DisconnectAsync() operation - that allows a user to disconnect and then call - again, such as UDP/IP. - - - - Create a new instance - - true if and only if the channel has the DisconnectAsync operation - that allows a user to disconnect and then call - again, such as UDP/IP. - - - If a is in use, then this value will be - set for . Must be > 0. - - - - - Returns true if and only if the channel has the DisconnectAsync() operation - that allows a user to disconnect and then call again, - such as UDP/IP. - - - - - If a is in use, then this is the default value for - . - - - - - Returns the of the specified name. - - The type of option being retrieved. - The name of the desired option. - The matching instance. - - - - Returns the of the given pair: (, secondary name) - - The type of option being retrieved. - - A whose name will be used as the first part of the desired option's name. - - - A string representing the second part of the desired option's name. - - The matching instance. - - - - Checks whether a given exists. - - The name of the . - true if a exists for the given , otherwise false. - - - - Creates a new for the given . - - The type of option to create. - The name to associate with the new option. - Thrown if a for the given exists. - The new instance. - - - - Adds the given message to this . The given - will be notified once the message was written. - - The message to add to the buffer. - The size of the message. - The to notify once the message is written. - - - - Add a flush to this . This means all previous added messages are marked - as flushed and so you will be able to handle them. - - - - - Increments the number of pending bytes which will be written at some point. - This method is thread-safe! - - The number of bytes to increment the count by. - - - - Decrements the number of pending bytes which will be written at some point. - This method is thread-safe! - - The number of bytes to decrement the count by. - - - - Returns the current message to write, or null if nothing was flushed before and so is ready to be - written. - - - - - Notify the of the current message about writing progress. - - - - - Removes the current message, marks its as complete, and returns - true. If no flushed message exists at the time this method is called, it returns false to - signal that no more messages are ready to be handled. - - true if a message existed and was removed, otherwise false. - - - - Removes the current message, marks its as complete using the given - , and returns true. If no flushed message exists at the time this method is - called, it returns false to signal that no more messages are ready to be handled. - - The causing the message to be removed. - true if a message existed and was removed, otherwise false. - - - - Removes the fully written entries and updates the reader index of the partially written entry. - This operation assumes all messages in this buffer are instances. - - The number of bytes that have been written so far. - - - - Clears all ByteBuffer from the array so these can be GC'ed. - See https://github.com/netty/netty/issues/3837 - - - - - Returns a list of direct ArraySegment<byte>, if the currently pending messages are made of - instances only. will return the total number of - readable bytes of these buffers. - - Note that the returned array is reused and thus should not escape - . Refer to - for an example. - - - A list of ArraySegment<byte> buffers. - - - - Returns a list of direct ArraySegment<byte>, if the currently pending messages are made of - instances only. will return the total number of - readable bytes of these buffers. - - Note that the returned array is reused and thus should not escape - . Refer to - for an example. - - - The maximum amount of buffers that will be added to the return value. - A hint toward the maximum number of bytes to include as part of the return value. Note that this value maybe exceeded because we make a best effort to include at least 1 in the return value to ensure write progress is made. - A list of ArraySegment<byte> buffers. - - - - Returns the number of bytes that can be written out of the array that was - obtained via . This method MUST be called after - . - - - - - Returns true if and only if the total number of pending bytes () - did not exceed the write watermark of the and no user-defined writability flag - () has been set to false. - - - - - Returns true if and only if the user-defined writability flag at the specified index is set to - true. - - The index to check for user-defined writability. - - true if the user-defined writability flag at the specified index is set to true. - - - - - Sets a user-defined writability flag at the specified index. - - The index where a writability flag should be set. - Whether to set the index as writable or not. - - - - Returns the number of flushed messages in this . - - - - - Returns true if there are flushed messages in this , otherwise - false. - - - - - Gets the number of bytes that can be written before returns false. - This quantity will always be non-negative. If is already false, then 0 is - returned. - - - The number of bytes that can be written before returns false. - - - - - Gets the number of bytes that must be drained from the underlying buffer before - returns true. This quantity will always be non-negative. If is already - true, then 0 is returned. - - - The number of bytes that can be written before returns true. - - - - - Calls for each flushed message in this - until returns - false or there are no more flushed messages to process. - - - The intance to use to process each flushed message. - - - - - Will be called for each flushed message until it either there are no more flushed messages or this method returns false. - - The message to process. - true if the given message was successfully processed, otherwise false. - - - - Shared configuration for SocketAsyncChannel. Provides access to pre-configured resources like ByteBuf allocator and - IO buffer pools - - - - - This is the head of a linked list that is processed by and so - process all the pending . We only keep the head because it is expected that - the list is used infrequently and its size is small. Thus full iterations to do insertions is assumed to be - a good compromised to saving memory and tail management complexity. - - - - - Set to true once the is registered. Once set to true, the - value will never change. - - - - - Returns the string representation of this pipeline. - - - - - Removes all handlers from the pipeline one by one from tail (exclusive) to head (exclusive) to trigger - . Note that we traverse up the pipeline - before traversing down so that the handlers are removed after all events are - handled. - See: https://github.com/netty/netty/issues/3156 - - - - - Called once an hits the end of the without being - handled by the user in . - - - - - Called once a message hits the end of the without being handled by the user - in . This method is responsible - for calling on the given msg at some point. - - - - - Default implementation of which respects - - and also prevents overflow. - - - - Focuses on enforcing the maximum messages per read condition for . - - - Only is used. - - - - Returns the default implementation, which returns 0 for unknown messages. - - - - - Creates a new instance. - - The size which is returned for unknown messages. - - - - Create a new instance with an empty pipeline. - - - - - Create a new instance with an empty pipeline with the specified . - - The of this channel. - - - - Create a new instance with the pipeline initialized with the specified handlers. - - - The s that will be added to the - - - - Create a new instance with the pipeline initialized with the specified handlers. - The of this channel. - - false if this will delegate - to , true otherwise. - - - The s that will be added to the - - - - - Returns the which holds all of the s that - were received by this . - - - - - Returns the which holds all of the s that - were written by this . - - - - - Return received data from this . - - - - - Read data from the outbound. This may return null if nothing is readable. - - - - - Run all tasks (which also includes scheduled tasks) that are pending in the - for this . - - - - - Run all pending scheduled tasks in the for this . - - - The when the next scheduled task is ready to run. If no other task is - scheduled then it will return . - - - - - Write messages to the inbound of this - - The messages to be written. - true if the write operation did add something to the inbound buffer - - - - Write messages to the outbound of this . - - The messages to be written. - true if the write operation did add something to the inbound buffer - - - - Mark this as finished. Any further try to write data to it will fail. - - bufferReadable returns true - - - - Marks this as finished and releases all pending message in the inbound and outbound - buffer. Any futher try to write data to it will fail. - - true if any of the used buffers has something left to read, otherwise false. - - - - Marks this as finished. Any futher attempt to write data to it will fail. - - If true, all pending messages in the inbound and outbound buffer are released. - true if any of the used buffers has something left to read, otherwise false. - - - - Releases all buffered inbound messages. - - true if any were in the inbound buffer, otherwise false. - - - - Releases all buffered outbound messages. - - true if any were in the outbound buffer, otherwise false. - - - - Check to see if there was any and rethrow if so. - - - - - Ensure the is open and if not throw an exception. - - - - - A dummy implementation - - - - - Create a new instance with an empty pipeline. - - - - - Create a new instance with an empty pipeline with the specified . - - The of this channel. - - - - Create a new instance with the pipeline initialized with the specified handlers. - - - The s that will be added to the - - - - Create a new instance with the pipeline initialized with the specified handlers. - The of this channel. - - false if this will delegate - to , true otherwise. - - - The s that will be added to the - - - - - Returns the which holds all of the s that - were received by this . - - - - - Returns the which holds all of the s that - were written by this . - - - - - Return received data from this . - - - - - Read data from the outbound. This may return null if nothing is readable. - - - - - Write messages to the inbound of this - - The messages to be written. - true if the write operation did add something to the inbound buffer - - - - Write messages to the outbound of this . - - The messages to be written. - true if the write operation did add something to the inbound buffer - - - - Mark this as finished. Any further try to write data to it will fail. - - bufferReadable returns true - - - - Marks this as finished and releases all pending message in the inbound and outbound - buffer. Any futher try to write data to it will fail. - - true if any of the used buffers has something left to read, otherwise false. - - - - Marks this as finished. Any futher attempt to write data to it will fail. - - If true, all pending messages in the inbound and outbound buffer are released. - true if any of the used buffers has something left to read, otherwise false. - - - - Releases all buffered inbound messages. - - true if any were in the inbound buffer, otherwise false. - - - - Releases all buffered outbound messages. - - true if any were in the outbound buffer, otherwise false. - - - - Check to see if there was any and rethrow if so. - - - - - Ensure the is open and if not throw an exception. - - - - - The that always yields the same buffer - size prediction. This predictor ignores the feedback from the I/O thread. - - - - - Creates a new predictor that always returns the same prediction of - the specified buffer size. - - - - - Returns the name of this group. A group name is purely for helping - you to distinguish one group from others. - - - - - Return the of the which describe the nature of the - . - - - - - The of the was registered with its - . - - - - - The of the was unregistered from its - . - - - - - Gets called once the writable state of a changed. You can check the state with - . - - - - - Called once a bind operation is made. - - - The for which the bind operation is made. - - The to which it should bind. - An await-able task. - - - - Called once a connect operation is made. - - - The for which the connect operation is made. - - The to which it should connect. - The which is used as source on connect. - An await-able task. - - - - Called once a disconnect operation is made. - - - The for which the disconnect operation is made. - - An await-able task. - - - - Returns the which is used to execute an arbitrary task. - - - - - The unique name of the . - - - The name was used when the was added to the . - This name can also be used to access the registered from the - . - - - - - A was registered to its . This will result in having the - method called of the next - contained in the of the . - - The current . - - - - A was unregistered from its . This will result in having the - method called of the next - contained in the of the . - - The current . - - - - Request to bind to the given . - - This will result in having the method called of the next - contained in the of the - . - - - The to bind to. - An await-able task. - - - - Request to connect to the given . - - This will result in having the method called of the next - contained in the of the - . - - - The to connect to. - An await-able task. - - - - Request to connect to the given while also binding to the localAddress. - - This will result in having the method called of the next - contained in the of the - . - - - The to connect to. - The to bind to. - An await-able task. - - - - Request to disconnect from the remote peer. - - This will result in having the method called of the next - contained in the of the - . - - - An await-able task. - - - - Request to deregister from the previous assigned . - - This will result in having the method called of the next - contained in the of the - . - - - An await-able task. - - - - A list of s which handles or intercepts inbound events and outbound operations of - a . implements an advanced form of the - Intercepting Filter pattern - to give a user full control over how an event is handled and how the s in a - pipeline interact with each other. - Creation of a pipeline - Each channel has its own pipeline and it is created automatically when a new channel is created. - How an event flows in a pipeline - - The following diagram describes how I/O events are processed by s in a - typically. An I/O event is handled by a and is - forwarded by the which handled the event to the - which is placed right next to it. A can also trigger an arbitrary I/O event if - necessary. To forward or trigger an event, a calls the event propagation methods - defined in , such as - and . - - -
-                    I/O Request
-                    via  or
-                    {@link ChannelHandlerContext} 
-                    |
-                    +---------------------------------------------------+---------------+
-                    |                           ChannelPipeline         |               |
-                    |                                                  \|/              |
-                    |    +----------------------------------------------+----------+    |
-                    |    |                   ChannelHandler  N                     |    |
-                    |    +----------+-----------------------------------+----------+    |
-                    |              /|\                                  |               |
-                    |               |                                  \|/              |
-                    |    +----------+-----------------------------------+----------+    |
-                    |    |                   ChannelHandler N-1                    |    |
-                    |    +----------+-----------------------------------+----------+    |
-                    |              /|\                                  .               |
-                    |               .                                   .               |
-                    | ChannelHandlerContext.fireIN_EVT() ChannelHandlerContext.OUT_EVT()|
-                    |          [method call]                      [method call]         |
-                    |               .                                   .               |
-                    |               .                                  \|/              |
-                    |    +----------+-----------------------------------+----------+    |
-                    |    |                   ChannelHandler  2                     |    |
-                    |    +----------+-----------------------------------+----------+    |
-                    |              /|\                                  |               |
-                    |               |                                  \|/              |
-                    |    +----------+-----------------------------------+----------+    |
-                    |    |                   ChannelHandler  1                     |    |
-                    |    +----------+-----------------------------------+----------+    |
-                    |              /|\                                  |               |
-                    +---------------+-----------------------------------+---------------+
-                    |                                  \|/
-                    +---------------+-----------------------------------+---------------+
-                    |               |                                   |               |
-                    |       [ Socket.read() ]                    [ Socket.write() ]     |
-                    |                                                                   |
-                    |  Netty Internal I/O Threads (Transport Implementation)            |
-                    +-------------------------------------------------------------------+
-                
-
- - An inbound event is handled by the s in the bottom-up direction as shown on the - left side of the diagram. An inbound event is usually triggered by the I/O thread on the bottom of the diagram - so that the s are notified when the state of a changes - (e.g. newly established connections and closed connections) or the inbound data was read from a remote peer. If - an inbound event goes beyond the at the top of the diagram, it is discarded and - logged, depending on your loglevel. - - - An outbound event is handled by the s in the top-down direction as shown on the - right side of the diagram. An outbound event is usually triggered by your code that requests an outbound I/O - operation, such as a write request and a connection attempt. If an outbound event goes beyond the - at the bottom of the diagram, it is handled by an I/O thread associated with the - . The I/O thread often performs the actual output operation such as - . - - Forwarding an event to the next handler - - As explained briefly above, a has to invoke the event propagation methods in - to forward an event to its next handler. Those methods include: -
    -
  • - Inbound event propagation methods: -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
  • - Outbound event propagation methods: -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    -
  • -
-
- - and the following example shows how the event propagation is usually done: - - public class MyInboundHandler : - { - public override void ChannelActive( ctx) - { - Console.WriteLine("Connected!"); - ctx.FireChannelActive(); - } - } - - public class MyOutboundHandler : - { - public override async Task CloseAsync( ctx) - { - Console.WriteLine("Closing..."); - await ctx.CloseAsync(); - } - } - - - Building a pipeline - - A user is supposed to have one or more s in a pipeline to receive I/O events - (e.g. read) and to request I/O operations (e.g. write and close). For example, a typical server will have the - following handlers in each channel's pipeline, but your mileage may vary depending on the complexity and - characteristics of the protocol and business logic: -
    -
  1. Protocol Decoder - translates binary data (e.g. ) into a Java object.
  2. -
  3. Protocol Encoder - translates a Java object into binary data.
  4. -
  5. Business Logic Handler - performs the actual business logic (e.g. database access).
  6. -
-
- - and it could be represented as shown in the following example: - - static readonly group = new (); - ... - pipeline = ch.Pipeline; - pipeline.AddLast("decoder", new MyProtocolDecoder()); - pipeline.AddLast("encoder", new MyProtocolEncoder()); - - // Tell the pipeline to run MyBusinessLogicHandler's event handler methods - // in a different thread than an I/O thread so that the I/O thread is not blocked by - // a time-consuming task. - // If your business logic is fully asynchronous or finished very quickly, you don't - // need to specify a group. - pipeline.AddLast(group, "handler", new MyBusinessLogicHandler()); - - - Thread safety - - An can be added or removed at any time because an - is thread safe. For example, you can insert an encryption handler when sensitive information is about to be - exchanged, and remove it after the exchange. - -
-
- - - Inserts an at the first position of this pipeline. - - - The name of the handler to insert first. Pass null to let the name auto-generated. - - The to insert first. - The . - - Thrown if an entry with the same already exists. - - Thrown if the specified handler is null. - - - - Inserts a at the first position of this pipeline. - - - The which invokes the 's event handler methods. - - - The name of the handler to insert first. Pass null to let the name be auto-generated. - - The to insert first. - This . - - Thrown if an entry with the same already exists. - - Thrown if the specified handler is null. - - - - Appends an at the last position of this pipeline. - - - The name of the handler to append. Pass null to let the name be auto-generated. - - The to append. - This . - - Thrown if an entry with the same already exists. - - Thrown if the specified handler is null. - - - - Appends a at the last position of this pipeline. - - - The which invokes the 's event handler methods. - - - The name of the handler to append. Pass null to let the name be auto-generated. - - The to append. - This . - - Thrown if an entry with the same already exists. - - Thrown if the specified handler is null. - - - - Inserts a before an existing handler of this pipeline. - - The name of the existing handler. - - The name of the new handler being appended. Pass null to let the name be auto-generated. - - The to append. - This . - - Thrown if an entry with the same already exists, or if no match was found for the - given . - - Thrown if the specified handler is null. - - - - Inserts a before an existing handler of this pipeline. - - - The which invokes the 's event handler methods. - - The name of the existing handler. - - The name of the new handler being appended. Pass null to let the name be auto-generated. - - The to append. - This . - - Thrown if an entry with the same already exists, or if no match was found for the - given . - - Thrown if the specified handler is null. - - - - Inserts a after an existing handler of this pipeline. - - The name of the existing handler. - - The name of the new handler being appended. Pass null to let the name be auto-generated. - - The handler to insert after. - This . - - Thrown if an entry with the same already exists, or if no match was found for the - given . - - Thrown if the specified handler is null. - - - - Inserts a after an existing handler of this pipeline. - - - The which invokes the 's event handler methods. - - The name of the existing handler. - - The name of the new handler being appended. Pass null to let the name be auto-generated. - - The handler to insert after. - This . - - Thrown if an entry with the same already exists, or if no match was found for the - given . - - Thrown if the specified handler is null. - - - - Inserts multiple s at the first position of this pipeline. - - The s to insert. - This . - - - - Inserts multiple s at the first position of this pipeline. - - - The which invokes the ' event handler methods. - - The s to insert. - This . - - - - Inserts multiple s at the last position of this pipeline. - - The s to insert. - This . - - - - Inserts multiple s at the last position of this pipeline. - - - The which invokes the ' event handler methods. - - The s to insert. - This . - - - - Removes the specified from this pipeline. - - The to remove. - This . - Thrown if the specified handler was not found. - - - - Removes the with the specified name from this pipeline. - - The name under which the was stored. - The removed . - - Thrown if there's no such handler with the specified name in this pipeline. - - - - - Removes the of the specified type from this pipeline. - - The type of handler to remove. - The removed . - Thrown if there's no handler of the specified type in this pipeline. - - - - Removes the first in this pipeline. - - The removed . - Thrown if this pipeline is empty. - - - - Removes the last in this pipeline. - - The removed . - Thrown if this pipeline is empty. - - - - Replaces the specified with a new handler in this pipeline. - - The to be replaced. - - The name of the new handler being inserted. Pass null to let the name be auto-generated. - - The new to be inserted. - This . - - Thrown if an entry with the same already exists, or if the - was not found. - - - - - Replaces the of the specified name with a new handler in this pipeline. - - The name of the to be replaced. - - The name of the new handler being inserted. Pass null to let the name be auto-generated. - - The new to be inserted. - The that was replaced. - - Thrown if an entry with the same already exists, or if no match was found for - the given . - - - - - Replaces the of the specified type with a new handler in this pipeline. - - The type of the handler to be removed. - - The name of the new handler being inserted. Pass null to let the name be auto-generated. - - The new to be inserted. - The that was replaced. - - Thrown if an entry with the same already exists, or if no match was found for - the given type. - - - - - Returns the first in this pipeline. - - The first handler in the pipeline, or null if the pipeline is empty. - - - - Returns the context of the first in this pipeline. - - - The context of the first handler in the pipeline, or null if the pipeline is empty. - - - - - Returns the last in this pipeline. - - The last handler in the pipeline, or null if the pipeline is empty. - - - - Returns the context of the last in this pipeline. - - - The context of the last handler in the pipeline, or null if the pipeline is empty. - - - - - Returns the with the specified name in this pipeline. - - The name of the desired . - - The handler with the specified name, or null if there's no such handler in this pipeline. - - - - - Returns the of the specified type in this pipeline. - - The type of handler to retrieve. - - The handler with the specified type, or null if there's no such handler in this pipeline. - - - - - Returns the context object of the specified in this pipeline. - - The whose context should be retrieved. - - The context object of the specified handler, or null if there's no such handler in this pipeline. - - - - - Returns the context object of the with the specified name in this pipeline. - - The name of the whose context should be retrieved. - - The context object of the handler with the specified name, or null if there's no such handler in - this pipeline. - - - - - Returns the context object of the of the specified type in this pipeline. - - The type of whose context should be retrieved. - - The context object of the handler with the specified type, or null if there's no such handler in - this pipeline. - - - - - Returns the that this pipeline is attached to. - Returns null if this pipeline is not attached to any channel yet. - - - - - An was registered to its . - This will result in having the method - called of the next contained in the of the - . - - This . - - - - An was unregistered from its . - This will result in having the method - called of the next contained in the of the - . - - This . - - - - An is active now, which means it is connected. - This will result in having the method - called of the next contained in the of the - . - - This . - - - - An is inactive now, which means it is closed. - This will result in having the method - called of the next contained in the of the - . - - This . - - - - An received an in one of its inbound operations. - This will result in having the method - called of the next contained in the of the - . - - The that was caught. - This . - - - - An received an user defined event. - This will result in having the method - called of the next contained in the of the - . - - The user-defined event that was triggered. - This . - - - - An received a message. - This will result in having the method - called of the next contained in the of the - . - - The message that was received. - This . - - - - An completed a message after reading it. - This will result in having the method - called of the next contained in the of the - . - - This . - - - - Triggers an event to the next - in the . - - This . - - - - Request to bind to the given . - - This will result in having the method called of the next - contained in the of the - . - - - - - - Request to connect to the given . - - This will result in having the method called of the next - contained in the of the - . - - - The remote to connect to. - An await-able task. - - - - Request to connect to the given . - - This will result in having the method called of the next - contained in the of the - . - - - The remote to connect to. - The local to bind. - An await-able task. - - - - Request to disconnect from the remote peer. - - This will result in having the method called of the next - contained in the of the - . - - - An await-able task. - - - - Request to close the . After it is closed it is not possible to reuse it again. - - This will result in having the method called of the next - contained in the of the - . - - - An await-able task. - - - - Request to deregister the bound this from the - previous assigned . - - This will result in having the method called of the next - contained in the of the - . - - - An await-able task. - - - - Request to Read data from the into the first inbound buffer, triggers an - event if data was read, and triggers a - event so the handler can decide whether to continue - reading. If there's a pending read operation already, this method does nothing. - - This will result in having the method called of the next - contained in the of the - . - - - This . - - - - Request to write a message via this . - This method will not request to actual flush, so be sure to call - once you want to request to flush all pending data to the actual transport. - - An await-able task. - - - - Request to flush all pending messages. - - This . - - - - Shortcut for calling both and . - - - - - specialized to handle I/O operations of assigned s. - - - - - Parent . - - - - - - specialized for handling s. - - - - - Returns list of owned event loops. - - - - - Returns one of owned event loops. - - - - - Register the for this event loop. - - The to register. - The register task. - - - - that limits the number of read operations that will be attempted when a read - operation - is attempted by the event loop. - - - - - Gets or sets the maximum number of messages to read per read loop. - If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages. - - - - - Creates a new handle. The handle provides the actual operations. - - - - - Calculates the size of the given message. - - The message for which the size should be calculated. - The size in bytes. The returned size must be >= 0 - - - - Allocates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough - not to waste its space. - - - - - Creates a new handle. The handle provides the actual operations and keeps the internal information which is - required for predicting an optimal buffer capacity. - - - - - Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small - enough not to waste its space. - - - - - Similar to except that it does not allocate anything but just tells the - capacity. - - - - - Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next - read loop. -

- This may be used by to determine if the read operation should complete. -

- This is only ever a hint and may be ignored by the implementation. -
- The channel configuration which may impact this object's behavior. -
- - Increment the number of messages that have been read for the current read loop. - The amount to increment by. - - - - Get or set the bytes that have been read for the last read operation. - This may be used to increment the number of bytes that have been read. - - - Returned value may be negative if an read error - occurs. If a negative value is seen it is expected to be return on the next set to - . A negative value will signal a termination condition enforced externally - to this class and is not required to be enforced in . - - - - Get or set how many bytes the read operation will (or did) attempt to read. - - - Determine if the current read loop should should continue. - true if the read loop should continue reading. false if the read loop is complete. - - - Signals read completion. - - - - A that accepts an incoming connection attempt and creates its child - s by accepting them. is a good example. - - - - - A for the local transport. - - - - - A for the local transport which allows in VM communication. - - - - - A factory method for s. Users may override it to create custom instances of s. - - An existing that will act as a peer for the new channel. - The newly created instance. - - - - backed by a set of instances. - - - - - - - - - - - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - - - - - - - - - - - A queue of write operations which are pending for later execution. It also updates the writability of the - associated (), so that the pending write operations are - also considered to determine the writability. - - - - - Returns true if there are no pending write operations left in this queue. - - - - - Returns the number of pending write operations. - - - - - Adds the given message to this . - - The message to add to the . - An await-able task. - - - - Removes all pending write operations, and fail them with the given . The messages - will be released via . - - The to fail with. - - - - Remove a pending write operation and fail it with the given . The message will be - released via . - - The to fail with. - - - - Removes all pending write operation and performs them via - - An await-able task. - - - - Removes a pending write operation and performs it via . - - An await-able task. - - - - Removes a pending write operation and releases it's message via - . - - - The of the pending write, or null if the queue is empty. - - - - - Return the current message, or null if the queue is empty. - - - - - Holds all meta-data and constructs the linked-list structure. - - - - - implementation based on . - - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - Creates a new instance of . - - - - - - - - - - base class for s that operate on bytes. - - - - Create a new instance - the parent by which this instance was created. May be null - the underlying on which it operates - - - - Reads bytes into the given and returns the number of bytes that were read. - - The to read bytes into. - The number of bytes that were read into the buffer. - - - - Writes bytes from the given to the underlying . - - The from which the bytes should be written. - The number of bytes that were written from the buffer. - - - - Set read pending to false. - - - - state before modification - - - PORT NOTE: matches behavior of NioEventLoop.processSelectedKey - - - - Finish connect - - - - - Read from underlying {@link SelectableChannel} - - - - - Connect to the remote peer - - - - - Finish the connect - - - - - base class for s that operate on messages. - - - - - Creates a new instance. - - The parent . Pass null if there's no parent. - The used by the for communication. - - - - Returns true if we should continue the write loop on a write error. - - - - - Reads messages into the given list and returns the amount which was read. - - The list into which message objects should be inserted. - The number of messages which were read. - - - - Writes a message to the underlying . - - The message to be written. - The destination channel buffer for the message. - true if the message was successfully written, otherwise false. - - - - Special event which will be fired and passed to the - methods once the input of an was shutdown and the - property returns true. - - - - - Singleton instance to use. - - - - - The default implementation. - - - - - Creates a new instance. - - - - - The default implementation. - - - - - A TCP/IP which accepts incoming TCP/IP connections. - - - - - A implementation which uses Socket-based implementation to accept new - connections. - - - - - Create a new instance - - - - - Create a new instance - - - - - Create a new instance using the given . - - - - - which uses Socket-based implementation. - - - - Create a new instance - - - Create a new instance - - - Create a new instance using the given . - - - Create a new instance - - the which created this instance or null if it was created by the - user - - the which will be used - - - - Marks the specified as success. If the - is done already, logs a message. - - The to complete. - The to use to log a failure message. - - - - Marks the specified as failure. If the - is done already, log a message. - - The to complete. - The to fail the with. - The to use to log a failure message. - -
-
+ + + + DotNetty.Transport + + + + + This is a helper class that makes it easy to bootstrap an . It supports method- + chaining to provide an easy way to configure the . + + When not used in a context, the methods + are useful for connectionless transports such as datagram (UDP). + + + + + Specifies the which will handle events for the being built. + + The which is used to handle all the events for the to-be-created . + The instance. + + + + Specifies the of which will be created. + + The which is used to create instances from. + The instance. + + + + Assigns the which is used to bind the local "end" to. + + The instance to bind the local "end" to. + The instance. + + + + Assigns the local which is used to bind the local "end" to. + This overload binds to a for any IP address on the local machine, given a specific port. + + The port to bind the local "end" to. + The instance. + + + + Assigns the local which is used to bind the local "end" to. + This overload binds to a for a given hostname and port. + + The hostname to bind the local "end" to. + The port to bind the local "end" to. + The instance. + + + + Assigns the local which is used to bind the local "end" to. + This overload binds to a for a given and port. + + The to bind the local "end" to. + The port to bind the local "end" to. + The instance. + + + + Allows the specification of a which is used for the + instances once they get created. Use a value of null to remove + a previously set . + + The to configure. + The value to set the given option. + + + + Allows specification of an initial attribute of the newly created . If the value is + null, the attribute of the specified key is removed. + + + + + Validates all the parameters. Sub-classes may override this, but should call the super method in that case. + + + + + Returns a deep clone of this bootstrap which has the identical configuration. This method is useful when making + multiple s with similar settings. Please note that this method does not clone the + deeply but shallowly, making the group a shared resource. + + + + + Creates a new and registers it with an . + + + + + Creates a new and binds it to the endpoint specified via the methods. + + The bound . + + + + Creates a new and binds it. + This overload binds to a for any IP address on the local machine, given a specific port. + + The port to bind the local "end" to. + The bound . + + + + Creates a new and binds it. + This overload binds to a for a given hostname and port. + + The hostname to bind the local "end" to. + The port to bind the local "end" to. + The bound . + + + + Creates a new and binds it. + This overload binds to a for a given and port. + + The to bind the local "end" to. + The port to bind the local "end" to. + The bound . + + + + Creates a new and binds it. + + The instance to bind the local "end" to. + The bound . + + + + Specifies the to use for serving the requests. + + The to use for serving requests. + The instance. + + + + Returns the configured or null if none is configured yet. + + + + + A that makes it easy to bootstrap an to use for clients. + + The methods are useful + in combination with connectionless transports such as datagram (UDP). For regular TCP connections, + please use the provided methods. + + + + + Sets the which will resolve the address of the unresolved named address. + + The which will resolve the address of the unresolved named address. + The instance. + + + + Assigns the remote to connect to once the method is called. + + The remote to connect to. + The instance. + + + + Assigns the remote to connect to once the method is called. + + The hostname of the endpoint to connect to. + The port at the remote host to connect to. + The instance. + + + + Assigns the remote to connect to once the method is called. + + The of the endpoint to connect to. + The port at the remote host to connect to. + The instance. + + + + Connects an to the remote peer. + + The . + + + + Connects an to the remote peer. + + The hostname of the endpoint to connect to. + The port at the remote host to connect to. + The . + + + + Connects an to the remote peer. + + The of the endpoint to connect to. + The port at the remote host to connect to. + The . + + + + Connects an to the remote peer. + + The remote to connect to. + The . + + + + Connects an to the remote peer. + + The remote to connect to. + The local to connect to. + The . + + + + Performs DNS resolution for the remote endpoint and connects to it. + + The remote to connect to. + The local to connect the remote to. + The . + + + + Returns a deep clone of this bootstrap which has the identical configuration except that it uses + the given . This method is useful when making multiple s with similar + settings. + + + + + A sub-class which allows easy bootstrapping of . + + + + + Specifies the which is used for the parent (acceptor) and the child (client). + + + + + Sets the for the parent (acceptor) and the child (client). These + 's are used to handle all the events and IO for + and 's. + + + + + Allows specification of a which is used for the + instances once they get created (after the acceptor accepted the ). Use a + value of null to remove a previously set . + + + + + Sets the specific with the given value on every child . + If the value is null, the is removed. + + + + + Sets the which is used to serve the request for the 's. + + + + + Returns the configured which will be used for the child channels or null + if none is configured yet. + + + + Cache for the string representation of this channel + + + + Creates a new instance. + + The parent of this channel. Pass null if there's no parent. + + + + Creates a new instance. + + The parent of this channel. Pass null if there's no parent. + An for the new channel. + + + + Resets the stored . + + + + + Returns a new instance. Subclasses may override this method to assign custom + s to s that use the constructor. + + A new instance. + + + Returns a new pipeline instance. + + + + Create a new instance which will be used for the life-time of the + + + + + + Returns the ID of this channel. + + + + + Returns true if and only if the specified object is identical + with this channel (i.e. this == o). + + + + + Returns the string representation of this channel. The returned string contains a hex dump of the + , the , and the of this + channel for easier identification. + + + + + implementation which sub-classes must extend and use. + + + + true if the channel has never been registered, false otherwise /// + + + + This method must NEVER be called directly, but be executed as an + extra task with a clean call stack instead. The reason for this + is that this method calls + directly, which might lead to an unfortunate nesting of independent inbound/outbound + events. See the comments input for more details. + + + + + Prepares to close the . If this method returns an , the + caller must call the method with a task that calls + on the returned . If this method returns null, + must be called from the caller thread. (i.e. ) + + + + + Checks whether a given is compatible with the . + + The to check compatibility. + + true if the given is compatible with this + instance, otherwise false. + + + + + Is called after the is registered with its as part of the + register process. Sub-classes may override this method. + + + + + Binds the to the . + + The to bind. + + + + Disconnects this from its remote peer. + + + + + Closes the . + + + + + Deregisters the from its . Sub-classes may override this + method. + + + + + ScheduleAsync a read operation. + + + + + Flush the content of the given buffer to the remote peer. + + + + + Invoked when a new message is added to a of this + , so that the implementation converts the message to + another. (e.g. heap buffer -> direct buffer). + + The message to be filtered. + The filtered message. + + + Neither nor was called. + + + was called. + + + was called. + + + + Makes best possible effort to detect if was + called + yet. If not return false and if called or could not detect return true. + If this method returns true we will not invoke the but just forward the + event. + This is needed as may already put the in the + linked-list + but not called + + + + + A skeletal server-side implementation. A server-side does not + allow the following operations: , + , , + . + + + + + Creates a new instance. + + + + + The that automatically increases and + decreases the predicted buffer size on feed back. +

+ It gradually increases the expected number of readable bytes if the previous + read fully filled the allocated buffer. It gradually decreases the expected + number of readable bytes if the read operation was not able to fill a certain + amount of the allocated buffer two times consecutively. Otherwise, it keeps + returning the same prediction. +

+
+ + + Creates a new predictor with the default parameters. With the default + parameters, the expected buffer size starts from 1024, does not + go down below 64, and does not go up above 65536. + + + + Creates a new predictor with the specified parameters. + the inclusive lower bound of the expected buffer size + the initial buffer size when no feed back was received + the inclusive upper bound of the expected buffer size + + + + that works as a wrapper for another providing affinity on call. + + + + + + + + Creates a new instance of . + + serving as an actual provider of s. + + + + If running in a context of an existing , this is returned. + Otherwise, is retrieved from underlying . + + + + + + + + A queue of write operations which are pending for later execution. It also updates the + writability of the associated , so that + the pending write operations are also considered to determine the writability. + + + + Returns true if there are no pending write operations left in this queue. + + + Returns the number of pending write operations. + + + Add the given msg and returns for completion of processing msg. + + + + Remove all pending write operation and fail them with the given . The messages will be + released + via . + + + + + Remove a pending write operation and fail it with the given . The message will be released + via + . + + + + + Remove all pending write operation and performs them via + . + + + if something was written and null if the + is empty. + + + + + Removes a pending write operation and performs it via + . + + + if something was written and null if the + is empty. + + + + + Removes a pending write operation and release it's message via . + + of the pending write or null if the queue is empty. + + + + Return the current message or null if empty. + + + + Holds all meta-data and construct the linked-list structure. + + + + It is a good starting point if your implementation needs to intercept operations and also + state updates. + + + + + A special which offers an easy way to initialize a once it was + registered to its . + + Implementations are most often used in the context of + and to setup the of a . + + Be aware that this class is marked as Sharable (via ) and so the implementation must be safe to be re-used. + + + + public class MyChannelInitializer extends { + public void InitChannel( channel) { + channel.Pipeline().AddLast("myHandler", new MyHandler()); + } + } + bootstrap = ...; + ... + bootstrap.childHandler(new MyChannelInitializer()); + ... + + + A sub-type of . + + + + This method will be called once the was registered. After the method returns this instance + will be removed from the of the . + + The which was registered. + + + Represents the properties of a implementation. + + + Create a new instance + + true if and only if the channel has the DisconnectAsync() operation + that allows a user to disconnect and then call + again, such as UDP/IP. + + + + Create a new instance + + true if and only if the channel has the DisconnectAsync operation + that allows a user to disconnect and then call + again, such as UDP/IP. + + + If a is in use, then this value will be + set for . Must be > 0. + + + + + Returns true if and only if the channel has the DisconnectAsync() operation + that allows a user to disconnect and then call again, + such as UDP/IP. + + + + + If a is in use, then this is the default value for + . + + + + + Returns the of the specified name. + + The type of option being retrieved. + The name of the desired option. + The matching instance. + + + + Returns the of the given pair: (, secondary name) + + The type of option being retrieved. + + A whose name will be used as the first part of the desired option's name. + + + A string representing the second part of the desired option's name. + + The matching instance. + + + + Checks whether a given exists. + + The name of the . + true if a exists for the given , otherwise false. + + + + Creates a new for the given . + + The type of option to create. + The name to associate with the new option. + Thrown if a for the given exists. + The new instance. + + + + Adds the given message to this . The given + will be notified once the message was written. + + The message to add to the buffer. + The size of the message. + The to notify once the message is written. + + + + Add a flush to this . This means all previous added messages are marked + as flushed and so you will be able to handle them. + + + + + Increments the number of pending bytes which will be written at some point. + This method is thread-safe! + + The number of bytes to increment the count by. + + + + Decrements the number of pending bytes which will be written at some point. + This method is thread-safe! + + The number of bytes to decrement the count by. + + + + Returns the current message to write, or null if nothing was flushed before and so is ready to be + written. + + + + + Notify the of the current message about writing progress. + + + + + Removes the current message, marks its as complete, and returns + true. If no flushed message exists at the time this method is called, it returns false to + signal that no more messages are ready to be handled. + + true if a message existed and was removed, otherwise false. + + + + Removes the current message, marks its as complete using the given + , and returns true. If no flushed message exists at the time this method is + called, it returns false to signal that no more messages are ready to be handled. + + The causing the message to be removed. + true if a message existed and was removed, otherwise false. + + + + Removes the fully written entries and updates the reader index of the partially written entry. + This operation assumes all messages in this buffer are instances. + + The number of bytes that have been written so far. + + + + Clears all ByteBuffer from the array so these can be GC'ed. + See https://github.com/netty/netty/issues/3837 + + + + + Returns a list of direct ArraySegment<byte>, if the currently pending messages are made of + instances only. will return the total number of + readable bytes of these buffers. + + Note that the returned array is reused and thus should not escape + . Refer to + for an example. + + + A list of ArraySegment<byte> buffers. + + + + Returns a list of direct ArraySegment<byte>, if the currently pending messages are made of + instances only. will return the total number of + readable bytes of these buffers. + + Note that the returned array is reused and thus should not escape + . Refer to + for an example. + + + The maximum amount of buffers that will be added to the return value. + A hint toward the maximum number of bytes to include as part of the return value. Note that this value maybe exceeded because we make a best effort to include at least 1 in the return value to ensure write progress is made. + A list of ArraySegment<byte> buffers. + + + + Returns the number of bytes that can be written out of the array that was + obtained via . This method MUST be called after + . + + + + + Returns true if and only if the total number of pending bytes () + did not exceed the write watermark of the and no user-defined writability flag + () has been set to false. + + + + + Returns true if and only if the user-defined writability flag at the specified index is set to + true. + + The index to check for user-defined writability. + + true if the user-defined writability flag at the specified index is set to true. + + + + + Sets a user-defined writability flag at the specified index. + + The index where a writability flag should be set. + Whether to set the index as writable or not. + + + + Returns the number of flushed messages in this . + + + + + Returns true if there are flushed messages in this , otherwise + false. + + + + + Gets the number of bytes that can be written before returns false. + This quantity will always be non-negative. If is already false, then 0 is + returned. + + + The number of bytes that can be written before returns false. + + + + + Gets the number of bytes that must be drained from the underlying buffer before + returns true. This quantity will always be non-negative. If is already + true, then 0 is returned. + + + The number of bytes that can be written before returns true. + + + + + Calls for each flushed message in this + until returns + false or there are no more flushed messages to process. + + + The intance to use to process each flushed message. + + + + + Will be called for each flushed message until it either there are no more flushed messages or this method returns false. + + The message to process. + true if the given message was successfully processed, otherwise false. + + + + Shared configuration for SocketAsyncChannel. Provides access to pre-configured resources like ByteBuf allocator and + IO buffer pools + + + + + This is the head of a linked list that is processed by and so + process all the pending . We only keep the head because it is expected that + the list is used infrequently and its size is small. Thus full iterations to do insertions is assumed to be + a good compromised to saving memory and tail management complexity. + + + + + Set to true once the is registered. Once set to true, the + value will never change. + + + + + Returns the string representation of this pipeline. + + + + + Removes all handlers from the pipeline one by one from tail (exclusive) to head (exclusive) to trigger + . Note that we traverse up the pipeline + before traversing down so that the handlers are removed after all events are + handled. + See: https://github.com/netty/netty/issues/3156 + + + + + Called once an hits the end of the without being + handled by the user in . + + + + + Called once a message hits the end of the without being handled by the user + in . This method is responsible + for calling on the given msg at some point. + + + + + Default implementation of which respects + + and also prevents overflow. + + + + Focuses on enforcing the maximum messages per read condition for . + + + Only is used. + + + + Returns the default implementation, which returns 0 for unknown messages. + + + + + Creates a new instance. + + The size which is returned for unknown messages. + + + + Create a new instance with an empty pipeline. + + + + + Create a new instance with an empty pipeline with the specified . + + The of this channel. + + + + Create a new instance with the pipeline initialized with the specified handlers. + + + The s that will be added to the + + + + Create a new instance with the pipeline initialized with the specified handlers. + The of this channel. + + false if this will delegate + to , true otherwise. + + + The s that will be added to the + + + + + Returns the which holds all of the s that + were received by this . + + + + + Returns the which holds all of the s that + were written by this . + + + + + Return received data from this . + + + + + Read data from the outbound. This may return null if nothing is readable. + + + + + Run all tasks (which also includes scheduled tasks) that are pending in the + for this . + + + + + Run all pending scheduled tasks in the for this . + + + The when the next scheduled task is ready to run. If no other task is + scheduled then it will return . + + + + + Write messages to the inbound of this + + The messages to be written. + true if the write operation did add something to the inbound buffer + + + + Write messages to the outbound of this . + + The messages to be written. + true if the write operation did add something to the inbound buffer + + + + Mark this as finished. Any further try to write data to it will fail. + + bufferReadable returns true + + + + Marks this as finished and releases all pending message in the inbound and outbound + buffer. Any futher try to write data to it will fail. + + true if any of the used buffers has something left to read, otherwise false. + + + + Marks this as finished. Any futher attempt to write data to it will fail. + + If true, all pending messages in the inbound and outbound buffer are released. + true if any of the used buffers has something left to read, otherwise false. + + + + Releases all buffered inbound messages. + + true if any were in the inbound buffer, otherwise false. + + + + Releases all buffered outbound messages. + + true if any were in the outbound buffer, otherwise false. + + + + Check to see if there was any and rethrow if so. + + + + + Ensure the is open and if not throw an exception. + + + + + A dummy implementation + + + + + Create a new instance with an empty pipeline. + + + + + Create a new instance with an empty pipeline with the specified . + + The of this channel. + + + + Create a new instance with the pipeline initialized with the specified handlers. + + + The s that will be added to the + + + + Create a new instance with the pipeline initialized with the specified handlers. + The of this channel. + + false if this will delegate + to , true otherwise. + + + The s that will be added to the + + + + + Returns the which holds all of the s that + were received by this . + + + + + Returns the which holds all of the s that + were written by this . + + + + + Return received data from this . + + + + + Read data from the outbound. This may return null if nothing is readable. + + + + + Write messages to the inbound of this + + The messages to be written. + true if the write operation did add something to the inbound buffer + + + + Write messages to the outbound of this . + + The messages to be written. + true if the write operation did add something to the inbound buffer + + + + Mark this as finished. Any further try to write data to it will fail. + + bufferReadable returns true + + + + Marks this as finished and releases all pending message in the inbound and outbound + buffer. Any futher try to write data to it will fail. + + true if any of the used buffers has something left to read, otherwise false. + + + + Marks this as finished. Any futher attempt to write data to it will fail. + + If true, all pending messages in the inbound and outbound buffer are released. + true if any of the used buffers has something left to read, otherwise false. + + + + Releases all buffered inbound messages. + + true if any were in the inbound buffer, otherwise false. + + + + Releases all buffered outbound messages. + + true if any were in the outbound buffer, otherwise false. + + + + Check to see if there was any and rethrow if so. + + + + + Ensure the is open and if not throw an exception. + + + + + The that always yields the same buffer + size prediction. This predictor ignores the feedback from the I/O thread. + + + + + Creates a new predictor that always returns the same prediction of + the specified buffer size. + + + + + Returns the name of this group. A group name is purely for helping + you to distinguish one group from others. + + + + + Return the of the which describe the nature of the + . + + + + + The of the was registered with its + . + + + + + The of the was unregistered from its + . + + + + + Gets called once the writable state of a changed. You can check the state with + . + + + + + Called once a bind operation is made. + + + The for which the bind operation is made. + + The to which it should bind. + An await-able task. + + + + Called once a connect operation is made. + + + The for which the connect operation is made. + + The to which it should connect. + The which is used as source on connect. + An await-able task. + + + + Called once a disconnect operation is made. + + + The for which the disconnect operation is made. + + An await-able task. + + + + Returns the which is used to execute an arbitrary task. + + + + + The unique name of the . + + + The name was used when the was added to the . + This name can also be used to access the registered from the + . + + + + + A was registered to its . This will result in having the + method called of the next + contained in the of the . + + The current . + + + + A was unregistered from its . This will result in having the + method called of the next + contained in the of the . + + The current . + + + + Request to bind to the given . + + This will result in having the method called of the next + contained in the of the + . + + + The to bind to. + An await-able task. + + + + Request to connect to the given . + + This will result in having the method called of the next + contained in the of the + . + + + The to connect to. + An await-able task. + + + + Request to connect to the given while also binding to the localAddress. + + This will result in having the method called of the next + contained in the of the + . + + + The to connect to. + The to bind to. + An await-able task. + + + + Request to disconnect from the remote peer. + + This will result in having the method called of the next + contained in the of the + . + + + An await-able task. + + + + Request to deregister from the previous assigned . + + This will result in having the method called of the next + contained in the of the + . + + + An await-able task. + + + + A list of s which handles or intercepts inbound events and outbound operations of + a . implements an advanced form of the + Intercepting Filter pattern + to give a user full control over how an event is handled and how the s in a + pipeline interact with each other. + Creation of a pipeline + Each channel has its own pipeline and it is created automatically when a new channel is created. + How an event flows in a pipeline + + The following diagram describes how I/O events are processed by s in a + typically. An I/O event is handled by a and is + forwarded by the which handled the event to the + which is placed right next to it. A can also trigger an arbitrary I/O event if + necessary. To forward or trigger an event, a calls the event propagation methods + defined in , such as + and . + + +
+                    I/O Request
+                    via  or
+                    {@link ChannelHandlerContext} 
+                    |
+                    +---------------------------------------------------+---------------+
+                    |                           ChannelPipeline         |               |
+                    |                                                  \|/              |
+                    |    +----------------------------------------------+----------+    |
+                    |    |                   ChannelHandler  N                     |    |
+                    |    +----------+-----------------------------------+----------+    |
+                    |              /|\                                  |               |
+                    |               |                                  \|/              |
+                    |    +----------+-----------------------------------+----------+    |
+                    |    |                   ChannelHandler N-1                    |    |
+                    |    +----------+-----------------------------------+----------+    |
+                    |              /|\                                  .               |
+                    |               .                                   .               |
+                    | ChannelHandlerContext.fireIN_EVT() ChannelHandlerContext.OUT_EVT()|
+                    |          [method call]                      [method call]         |
+                    |               .                                   .               |
+                    |               .                                  \|/              |
+                    |    +----------+-----------------------------------+----------+    |
+                    |    |                   ChannelHandler  2                     |    |
+                    |    +----------+-----------------------------------+----------+    |
+                    |              /|\                                  |               |
+                    |               |                                  \|/              |
+                    |    +----------+-----------------------------------+----------+    |
+                    |    |                   ChannelHandler  1                     |    |
+                    |    +----------+-----------------------------------+----------+    |
+                    |              /|\                                  |               |
+                    +---------------+-----------------------------------+---------------+
+                    |                                  \|/
+                    +---------------+-----------------------------------+---------------+
+                    |               |                                   |               |
+                    |       [ Socket.read() ]                    [ Socket.write() ]     |
+                    |                                                                   |
+                    |  Netty Internal I/O Threads (Transport Implementation)            |
+                    +-------------------------------------------------------------------+
+                
+
+ + An inbound event is handled by the s in the bottom-up direction as shown on the + left side of the diagram. An inbound event is usually triggered by the I/O thread on the bottom of the diagram + so that the s are notified when the state of a changes + (e.g. newly established connections and closed connections) or the inbound data was read from a remote peer. If + an inbound event goes beyond the at the top of the diagram, it is discarded and + logged, depending on your loglevel. + + + An outbound event is handled by the s in the top-down direction as shown on the + right side of the diagram. An outbound event is usually triggered by your code that requests an outbound I/O + operation, such as a write request and a connection attempt. If an outbound event goes beyond the + at the bottom of the diagram, it is handled by an I/O thread associated with the + . The I/O thread often performs the actual output operation such as + . + + Forwarding an event to the next handler + + As explained briefly above, a has to invoke the event propagation methods in + to forward an event to its next handler. Those methods include: +
    +
  • + Inbound event propagation methods: +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
  • + Outbound event propagation methods: +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
  • +
+
+ + and the following example shows how the event propagation is usually done: + + public class MyInboundHandler : + { + public override void ChannelActive( ctx) + { + Console.WriteLine("Connected!"); + ctx.FireChannelActive(); + } + } + + public class MyOutboundHandler : + { + public override async Task CloseAsync( ctx) + { + Console.WriteLine("Closing..."); + await ctx.CloseAsync(); + } + } + + + Building a pipeline + + A user is supposed to have one or more s in a pipeline to receive I/O events + (e.g. read) and to request I/O operations (e.g. write and close). For example, a typical server will have the + following handlers in each channel's pipeline, but your mileage may vary depending on the complexity and + characteristics of the protocol and business logic: +
    +
  1. Protocol Decoder - translates binary data (e.g. ) into a Java object.
  2. +
  3. Protocol Encoder - translates a Java object into binary data.
  4. +
  5. Business Logic Handler - performs the actual business logic (e.g. database access).
  6. +
+
+ + and it could be represented as shown in the following example: + + static readonly group = new (); + ... + pipeline = ch.Pipeline; + pipeline.AddLast("decoder", new MyProtocolDecoder()); + pipeline.AddLast("encoder", new MyProtocolEncoder()); + + // Tell the pipeline to run MyBusinessLogicHandler's event handler methods + // in a different thread than an I/O thread so that the I/O thread is not blocked by + // a time-consuming task. + // If your business logic is fully asynchronous or finished very quickly, you don't + // need to specify a group. + pipeline.AddLast(group, "handler", new MyBusinessLogicHandler()); + + + Thread safety + + An can be added or removed at any time because an + is thread safe. For example, you can insert an encryption handler when sensitive information is about to be + exchanged, and remove it after the exchange. + +
+
+ + + Inserts an at the first position of this pipeline. + + + The name of the handler to insert first. Pass null to let the name auto-generated. + + The to insert first. + The . + + Thrown if an entry with the same already exists. + + Thrown if the specified handler is null. + + + + Inserts a at the first position of this pipeline. + + + The which invokes the 's event handler methods. + + + The name of the handler to insert first. Pass null to let the name be auto-generated. + + The to insert first. + This . + + Thrown if an entry with the same already exists. + + Thrown if the specified handler is null. + + + + Appends an at the last position of this pipeline. + + + The name of the handler to append. Pass null to let the name be auto-generated. + + The to append. + This . + + Thrown if an entry with the same already exists. + + Thrown if the specified handler is null. + + + + Appends a at the last position of this pipeline. + + + The which invokes the 's event handler methods. + + + The name of the handler to append. Pass null to let the name be auto-generated. + + The to append. + This . + + Thrown if an entry with the same already exists. + + Thrown if the specified handler is null. + + + + Inserts a before an existing handler of this pipeline. + + The name of the existing handler. + + The name of the new handler being appended. Pass null to let the name be auto-generated. + + The to append. + This . + + Thrown if an entry with the same already exists, or if no match was found for the + given . + + Thrown if the specified handler is null. + + + + Inserts a before an existing handler of this pipeline. + + + The which invokes the 's event handler methods. + + The name of the existing handler. + + The name of the new handler being appended. Pass null to let the name be auto-generated. + + The to append. + This . + + Thrown if an entry with the same already exists, or if no match was found for the + given . + + Thrown if the specified handler is null. + + + + Inserts a after an existing handler of this pipeline. + + The name of the existing handler. + + The name of the new handler being appended. Pass null to let the name be auto-generated. + + The handler to insert after. + This . + + Thrown if an entry with the same already exists, or if no match was found for the + given . + + Thrown if the specified handler is null. + + + + Inserts a after an existing handler of this pipeline. + + + The which invokes the 's event handler methods. + + The name of the existing handler. + + The name of the new handler being appended. Pass null to let the name be auto-generated. + + The handler to insert after. + This . + + Thrown if an entry with the same already exists, or if no match was found for the + given . + + Thrown if the specified handler is null. + + + + Inserts multiple s at the first position of this pipeline. + + The s to insert. + This . + + + + Inserts multiple s at the first position of this pipeline. + + + The which invokes the ' event handler methods. + + The s to insert. + This . + + + + Inserts multiple s at the last position of this pipeline. + + The s to insert. + This . + + + + Inserts multiple s at the last position of this pipeline. + + + The which invokes the ' event handler methods. + + The s to insert. + This . + + + + Removes the specified from this pipeline. + + The to remove. + This . + Thrown if the specified handler was not found. + + + + Removes the with the specified name from this pipeline. + + The name under which the was stored. + The removed . + + Thrown if there's no such handler with the specified name in this pipeline. + + + + + Removes the of the specified type from this pipeline. + + The type of handler to remove. + The removed . + Thrown if there's no handler of the specified type in this pipeline. + + + + Removes the first in this pipeline. + + The removed . + Thrown if this pipeline is empty. + + + + Removes the last in this pipeline. + + The removed . + Thrown if this pipeline is empty. + + + + Replaces the specified with a new handler in this pipeline. + + The to be replaced. + + The name of the new handler being inserted. Pass null to let the name be auto-generated. + + The new to be inserted. + This . + + Thrown if an entry with the same already exists, or if the + was not found. + + + + + Replaces the of the specified name with a new handler in this pipeline. + + The name of the to be replaced. + + The name of the new handler being inserted. Pass null to let the name be auto-generated. + + The new to be inserted. + The that was replaced. + + Thrown if an entry with the same already exists, or if no match was found for + the given . + + + + + Replaces the of the specified type with a new handler in this pipeline. + + The type of the handler to be removed. + + The name of the new handler being inserted. Pass null to let the name be auto-generated. + + The new to be inserted. + The that was replaced. + + Thrown if an entry with the same already exists, or if no match was found for + the given type. + + + + + Returns the first in this pipeline. + + The first handler in the pipeline, or null if the pipeline is empty. + + + + Returns the context of the first in this pipeline. + + + The context of the first handler in the pipeline, or null if the pipeline is empty. + + + + + Returns the last in this pipeline. + + The last handler in the pipeline, or null if the pipeline is empty. + + + + Returns the context of the last in this pipeline. + + + The context of the last handler in the pipeline, or null if the pipeline is empty. + + + + + Returns the with the specified name in this pipeline. + + The name of the desired . + + The handler with the specified name, or null if there's no such handler in this pipeline. + + + + + Returns the of the specified type in this pipeline. + + The type of handler to retrieve. + + The handler with the specified type, or null if there's no such handler in this pipeline. + + + + + Returns the context object of the specified in this pipeline. + + The whose context should be retrieved. + + The context object of the specified handler, or null if there's no such handler in this pipeline. + + + + + Returns the context object of the with the specified name in this pipeline. + + The name of the whose context should be retrieved. + + The context object of the handler with the specified name, or null if there's no such handler in + this pipeline. + + + + + Returns the context object of the of the specified type in this pipeline. + + The type of whose context should be retrieved. + + The context object of the handler with the specified type, or null if there's no such handler in + this pipeline. + + + + + Returns the that this pipeline is attached to. + Returns null if this pipeline is not attached to any channel yet. + + + + + An was registered to its . + This will result in having the method + called of the next contained in the of the + . + + This . + + + + An was unregistered from its . + This will result in having the method + called of the next contained in the of the + . + + This . + + + + An is active now, which means it is connected. + This will result in having the method + called of the next contained in the of the + . + + This . + + + + An is inactive now, which means it is closed. + This will result in having the method + called of the next contained in the of the + . + + This . + + + + An received an in one of its inbound operations. + This will result in having the method + called of the next contained in the of the + . + + The that was caught. + This . + + + + An received an user defined event. + This will result in having the method + called of the next contained in the of the + . + + The user-defined event that was triggered. + This . + + + + An received a message. + This will result in having the method + called of the next contained in the of the + . + + The message that was received. + This . + + + + An completed a message after reading it. + This will result in having the method + called of the next contained in the of the + . + + This . + + + + Triggers an event to the next + in the . + + This . + + + + Request to bind to the given . + + This will result in having the method called of the next + contained in the of the + . + + + + + + Request to connect to the given . + + This will result in having the method called of the next + contained in the of the + . + + + The remote to connect to. + An await-able task. + + + + Request to connect to the given . + + This will result in having the method called of the next + contained in the of the + . + + + The remote to connect to. + The local to bind. + An await-able task. + + + + Request to disconnect from the remote peer. + + This will result in having the method called of the next + contained in the of the + . + + + An await-able task. + + + + Request to close the . After it is closed it is not possible to reuse it again. + + This will result in having the method called of the next + contained in the of the + . + + + An await-able task. + + + + Request to deregister the bound this from the + previous assigned . + + This will result in having the method called of the next + contained in the of the + . + + + An await-able task. + + + + Request to Read data from the into the first inbound buffer, triggers an + event if data was read, and triggers a + event so the handler can decide whether to continue + reading. If there's a pending read operation already, this method does nothing. + + This will result in having the method called of the next + contained in the of the + . + + + This . + + + + Request to write a message via this . + This method will not request to actual flush, so be sure to call + once you want to request to flush all pending data to the actual transport. + + An await-able task. + + + + Request to flush all pending messages. + + This . + + + + Shortcut for calling both and . + + + + + specialized to handle I/O operations of assigned s. + + + + + Parent . + + + + + + specialized for handling s. + + + + + Returns list of owned event loops. + + + + + Returns one of owned event loops. + + + + + Register the for this event loop. + + The to register. + The register task. + + + + that limits the number of read operations that will be attempted when a read + operation + is attempted by the event loop. + + + + + Gets or sets the maximum number of messages to read per read loop. + If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages. + + + + + Creates a new handle. The handle provides the actual operations. + + + + + Calculates the size of the given message. + + The message for which the size should be calculated. + The size in bytes. The returned size must be >= 0 + + + + Allocates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough + not to waste its space. + + + + + Creates a new handle. The handle provides the actual operations and keeps the internal information which is + required for predicting an optimal buffer capacity. + + + + + Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small + enough not to waste its space. + + + + + Similar to except that it does not allocate anything but just tells the + capacity. + + + + + Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next + read loop. +

+ This may be used by to determine if the read operation should complete. +

+ This is only ever a hint and may be ignored by the implementation. +
+ The channel configuration which may impact this object's behavior. +
+ + Increment the number of messages that have been read for the current read loop. + The amount to increment by. + + + + Get or set the bytes that have been read for the last read operation. + This may be used to increment the number of bytes that have been read. + + + Returned value may be negative if an read error + occurs. If a negative value is seen it is expected to be return on the next set to + . A negative value will signal a termination condition enforced externally + to this class and is not required to be enforced in . + + + + Get or set how many bytes the read operation will (or did) attempt to read. + + + Determine if the current read loop should should continue. + true if the read loop should continue reading. false if the read loop is complete. + + + Signals read completion. + + + + A that accepts an incoming connection attempt and creates its child + s by accepting them. is a good example. + + + + + A for the local transport. + + + + + A for the local transport which allows in VM communication. + + + + + A factory method for s. Users may override it to create custom instances of s. + + An existing that will act as a peer for the new channel. + The newly created instance. + + + + backed by a set of instances. + + + + + + + + + + + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + + + + + + + + + + + A queue of write operations which are pending for later execution. It also updates the writability of the + associated (), so that the pending write operations are + also considered to determine the writability. + + + + + Returns true if there are no pending write operations left in this queue. + + + + + Returns the number of pending write operations. + + + + + Adds the given message to this . + + The message to add to the . + An await-able task. + + + + Removes all pending write operations, and fail them with the given . The messages + will be released via . + + The to fail with. + + + + Remove a pending write operation and fail it with the given . The message will be + released via . + + The to fail with. + + + + Removes all pending write operation and performs them via + + An await-able task. + + + + Removes a pending write operation and performs it via . + + An await-able task. + + + + Removes a pending write operation and releases it's message via + . + + + The of the pending write, or null if the queue is empty. + + + + + Return the current message, or null if the queue is empty. + + + + + Holds all meta-data and constructs the linked-list structure. + + + + + implementation based on . + + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + Creates a new instance of . + + + + + + + + + + base class for s that operate on bytes. + + + + Create a new instance + the parent by which this instance was created. May be null + the underlying on which it operates + + + + Reads bytes into the given and returns the number of bytes that were read. + + The to read bytes into. + The number of bytes that were read into the buffer. + + + + Writes bytes from the given to the underlying . + + The from which the bytes should be written. + The number of bytes that were written from the buffer. + + + + Set read pending to false. + + + + state before modification + + + PORT NOTE: matches behavior of NioEventLoop.processSelectedKey + + + + Finish connect + + + + + Read from underlying {@link SelectableChannel} + + + + + Connect to the remote peer + + + + + Finish the connect + + + + + base class for s that operate on messages. + + + + + Creates a new instance. + + The parent . Pass null if there's no parent. + The used by the for communication. + + + + Returns true if we should continue the write loop on a write error. + + + + + Reads messages into the given list and returns the amount which was read. + + The list into which message objects should be inserted. + The number of messages which were read. + + + + Writes a message to the underlying . + + The message to be written. + The destination channel buffer for the message. + true if the message was successfully written, otherwise false. + + + + Special event which will be fired and passed to the + methods once the input of an was shutdown and the + property returns true. + + + + + Singleton instance to use. + + + + + The default implementation. + + + + + Creates a new instance. + + + + + The default implementation. + + + + + A TCP/IP which accepts incoming TCP/IP connections. + + + + + A implementation which uses Socket-based implementation to accept new + connections. + + + + + Create a new instance + + + + + Create a new instance + + + + + Create a new instance using the given . + + + + + which uses Socket-based implementation. + + + + Create a new instance + + + Create a new instance + + + Create a new instance using the given . + + + Create a new instance + + the which created this instance or null if it was created by the + user + + the which will be used + + + + Marks the specified as success. If the + is done already, logs a message. + + The to complete. + The to use to log a failure message. + + + + Marks the specified as failure. If the + is done already, log a message. + + The to complete. + The to fail the with. + The to use to log a failure message. + +
+
diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml.meta index fa202eb..0a47e42 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Transport.xml.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 312af1fcd31a2ef4a8ef4ed76e440da1 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 312af1fcd31a2ef4a8ef4ed76e440da1 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.mdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.mdb.meta index 82d5aac..4a0d707 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.mdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.mdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: cdb39fee38ded5b408550015cdae617b -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: cdb39fee38ded5b408550015cdae617b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.meta index fe4f3fa..be6c2e3 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: 4db51436488319e45a2ca4dabf4edc99 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 4db51436488319e45a2ca4dabf4edc99 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.pdb.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.pdb.meta index 4f5c9d8..9473fab 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.pdb.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.pdb.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: ffb2d4af7be12054db81762b2d585887 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: ffb2d4af7be12054db81762b2d585887 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml index dda424b..b82c3ca 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml @@ -1,8 +1,8 @@ - - - - DotNetty.Unity - - - - + + + + DotNetty.Unity + + + + diff --git a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml.meta b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml.meta index bf6366e..1805ece 100644 --- a/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml.meta +++ b/Runtime/csharp-kcp/Plugins/DotNetty.Unity.xml.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 6957bfcee5d34ae4987f8c9817282acd -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 6957bfcee5d34ae4987f8c9817282acd +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/LICENSE.txt.meta b/Runtime/csharp-kcp/Plugins/LICENSE.txt.meta index abddea6..3e879d4 100644 --- a/Runtime/csharp-kcp/Plugins/LICENSE.txt.meta +++ b/Runtime/csharp-kcp/Plugins/LICENSE.txt.meta @@ -1,7 +1,7 @@ -fileFormatVersion: 2 -guid: 38df922502fef2a4d8e81048b1d7ef61 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 38df922502fef2a4d8e81048b1d7ef61 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/csharp-kcp/Plugins/System.Runtime.CompilerServices.Unsafe.dll.meta b/Runtime/csharp-kcp/Plugins/System.Runtime.CompilerServices.Unsafe.dll.meta index e40bae4..5447d3b 100644 --- a/Runtime/csharp-kcp/Plugins/System.Runtime.CompilerServices.Unsafe.dll.meta +++ b/Runtime/csharp-kcp/Plugins/System.Runtime.CompilerServices.Unsafe.dll.meta @@ -1,33 +1,33 @@ -fileFormatVersion: 2 -guid: 1b39c08ffc7e2004495f915f82d909ef -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 0 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - Any: - second: - enabled: 1 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - - first: - Windows Store Apps: WindowsStoreApps - second: - enabled: 0 - settings: - CPU: AnyCPU - userData: - assetBundleName: - assetBundleVariant: +fileFormatVersion: 2 +guid: 1b39c08ffc7e2004495f915f82d909ef +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: