SuperSocket.ProtoBase
the string parser who use SPACE to separate string into many parts
The default singlegton instance
Initializes a new instance of the class.
Initializes a new instance of the class.
The spliter between command name and command parameters.
The parameter spliter.
parse the source string into key, body and parameters parts
the source string
the parsed key
the parsed body
the parsed parameter
The interface for the stream class whose data is consistent of many data segments
read data from the stream to the specific buffer
the target buffer
offset you want to read
total count you want to read
Read one byte from the stream
Reads a Int16 number from the current data source.
Reads a Int16 number from the current data source.
if set to true read the value as little endian, otherwise big endian.
Reads a UInt16 number from the current data source.
Reads a UInt16 number from the current data source.
if set to true read the value as little endian, otherwise big endian.
Reads a Int32 number from the current data source.
Reads a Int32 number from the current data source.
if set to true read the value as little endian, otherwise big endian.
Reads a UInt32 number from the current data source.
Reads a UInt32 number from the current data source.
if set to true read the value as little endian, otherwise big endian.
Reads a Int64 number from the current data source.
Reads a Int64 number from the current data source.
if set to true read the value as little endian, otherwise big endian.
Reads a UInt64 number from the current data source.
Reads a UInt64 number from the current data source.
if set to true read the value as little endian, otherwise big endian.
Takes the data of the specified length.
The length.
Reads a string from the current data source
The length of the string in bytes.
The encoding.
Skips the specified count bytes from the data source.
The number of bytes to skip.
Get current buffer as Stream
the stream represent the current buffer
Total length of the buffered data
All buffered binary segments in the stream
Clear all data in the buffer
The default buffer stream
Buffer used for temporary storage before conversion into primitives
Initializes a new instance of the class.
Initializes the specified segments.
The segments.
The length of segments must be greater than zero.
Gets the current buffer stream from the thread context
The current buffer stream
Gets the current buffer stream from the thread context
The type of the stream.
All buffered binary segments in the stream
Get current buffer as Stream
the stream represent the current buffer
Resets this stream.
/// Clear all data in the buffer
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
true if the stream supports reading; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
true if the stream supports seeking; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
When overridden in a derived class, gets the length in bytes of the stream.
A long value representing the length of the stream in bytes.
When overridden in a derived class, gets or sets the position within the current stream.
The current position within the stream.
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.
The zero-based byte offset in at which to begin storing the data read from the current stream.
The maximum number of bytes to be read from the current stream.
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
When overridden in a derived class, sets the position within the current stream.
A byte offset relative to the parameter.
A value of type indicating the reference point used to obtain the new position.
The new position within the current stream.
Cannot support seek from the end.
Exceed the stream's end
When overridden in a derived class, sets the length of the current stream.
The desired length of the current stream in bytes.
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
An array of bytes. This method copies bytes from to the current stream.
The zero-based byte offset in at which to begin copying bytes to the current stream.
The number of bytes to be written to the current stream.
Check to see if this instance is initialized.
This instance is not initialized.s
Skips the specified count bytes from the data source.
The count.
count;count cannot be negative
or
count;exceed the total length
Takes the data of the specified length.
The length.
Reads a string from the current data source
The length of the string in bytes.
The encoding.
length;there is no enougth data
Fills the buffer.
The length.
length;the length must between 1 and 8
or
length;there is no enough data to read
Reads a Int16 number from the current data source.
Reads a Int16 number from the current data source.
if set to true [little endian].
Reads a UInt16 number from the current data source.
Reads a UInt16 number from the current data source.
if set to true [little endian].
Reads a Int32 number from the current data source.
Reads a Int32 number from the current data source.
if set to true [little endian].
Reads a UInt32 number from the current data source.
Reads a UInt32 number from the current data source.
if set to true [little endian].
Reads a Int64 number from the current data source.
Reads a Int64 number from the current data source.
if set to true [little endian].
Reads a UInt64 number from the current data source.
Reads a UInt64 number from the current data source.
if set to true [little endian].
Gets a value by reading the buffer as a big endian integer.
The buffer to read the data from.
The number bytes to convert.
Code taken from Jon Skeet's Miscellaneous Utility Library
<a href="http://www.yoda.arachsys.com/csharp/miscutil/">Jon Skeet's Miscellaneous Utility Library</a>
Gets a value by reading the buffer as a little endian integer.
The buffer to read the data from.
The number bytes to convert.
Code taken from Jon Skeet's Miscellaneous Utility Library
<a href="http://www.yoda.arachsys.com/csharp/miscutil/">Jon Skeet's Miscellaneous Utility Library</a>
The buffer manager interface
Gets the buffer.
The size of the resired buffer.
Returns the buffer.
The buffer.
Runtime memory assignment buffer manager (no buffer)
Gets the buffer.
The size of the resired buffer.
Returns the buffer.
The buffer.
CloseReason enum
The socket is closed for unknown reason
Close for server shutdown
The client close the socket
The server side close the socket
Application error
The socket is closed for a socket error
The socket is closed by server for timeout
Protocol error
SuperSocket internal error
The interface for protocol encoder of binary data
Encode the binary data
the output buffer
the binary data to be encoded
the output binary data
Encode the binary segments
the output buffer
the binary segments to be encoded
the output binary data
The interface for protocol encoder of text messages
Encode text message
the output buffer
the message to be encoded
the output binary data
Extentions class
Gets string from the binary segments data.
The text encoding to decode the binary data.
The binary segments data.
the decoded string
Gets string from the binary segments data.
The text encoding to decode the binary data.
The binary segments data.
The offset.
The length.
the decoded string
Gets the buffer stream instance which can be reused.
The type of the package info.
The receive filter.
The data.
Gets the buffer stream instance which can be reused.
The type of the stream.
The type of the package info.
The receive filter.
The data.
Copies data of data segment list to a data segment.
The package data.
The data.
Copies data of data segment list to a data segment.
The source segments data.
The destination segment.
The source offset.
The length.
Filter state enum
Normal state
Error state
Http header info
default constructor of HttpHeaderInfo
Gets the method.
The method.
Gets the path.
The path.
Gets the version.
The version.
Get item from header with key
The http receive filter base class
The type of the package info.
Http header terminator
Header part text encoding
Initializes a new instance of the class.
Initializes a new instance of the class.
Header part text encoding
Initializes a new instance of the class.
Header part text encoding
the terminator of the header part
Gets the receive filter for body.
The header.
Size of the header.
Resolves the HTTP package without body.
The http header.
Resolves the package binary data to package instance
The received buffer stream.
the resolved package instance
IHttpRequestInfo
Gets the http header.
HttpRequestInfoBase
Gets the key of this request.
Gets the http header.
Initializes a new instance of the class.
The key.
The header.
HttpPackageInfoBase
The type of the request body.
Gets the body.
Initializes a new instance of the class.
The key.
The header.
The body.
The interface for buffered package info
Gets the buffered data.
The buffered data.
The buffer recycler interface
Returns the specified buffers.
The buffers.
The offset.
The length.
The buffer recycler which do nothings
The buffer state interface
Decreases the reference count of this buffer state
Increases the reference count of this buffer state
The buffer state base class
Decreases the reference count of this buffer state
Increases the reference count of this buffer state
The interface for communication channel
Send the binary segment to the other endpoint through this communication channel
the data segment to be sent
Close the communication channel
The reason.
The output buffer interface
add single one item into the queue
the item to be inserted
add multiple items into the queue
the multiple items to be inserted
Package handler interface
The type of the package info.
Handles the specified received package.
The received package.
The basic package info interface
The basic package info interface with key
The type of the key.
Gets the key of the package info
The key.
The package resolver interface
The type of the package info.
Resolves the package binary data to package instance
The received buffer stream.
the resolved package instance
The pipeline data processor
Processes the input segment.
The input segment.
the processing result
Gets the received cache.
The cache.
Reset the state of the processor to the initial status
the protocol handler interface
Determines whether this instance can send.
Gets the data encoder.
The data encoder.
Closes the specified channel.
The channel.
The reason.
The receive filter interface
The type of the package info.
Filters the received data.
The received data.
The length of the rest data after filtering.
the received packageInfo instance
Gets the next receive filter which will be used when the next network data is received
The next receive filter.
Gets the state of the current filter.
The filter state.
Resets this receive filter.
the interface to support resolving the cached buffers into package without basic network protocol resolving
Resolves the package binary data to package instance
The received buffer.
the resolved package instance
the interface for the tools to parse string into key, body and parameters parts
parse the source string into key, body and parameters parts
the source string
the parsed key
the parsed body
the parsed parameter
MimeHeader Helper class
Parses the HTTP header.
The header data.
The header.
Pakcage info class template with key and body parts
The type of the key.
The type of the body.
Gets the key.
The key.
Gets the body.
The body.
Initializes a new instance of the class.
The key.
The body.
The pipeline data processing result
Gets the state.
The state.
Gets the message.
The message.
the all packages which are resolved by this round processing
Creates a processing result with the specified state.
The state.
Creates a processing result with the specified state.
The state.
The message.
Creates a processing result with the specified state.
The state.
The packages which were processed in this round.
Creates a processing result with the specified state.
The state.
The message.
The packages which were processed in this round.
Buffered package info
The type of the key.
Gets the key.
The key.
Initializes a new instance of the class.
The key.
The data.
Gets the buffered data.
The buffered data.
Buffered package info
Initializes a new instance of the class.
The key.
The data.
The receive cache
Gets the last buffer segment.
The last.
Determines the index of a specific item in the .
The object to locate in the .
The index of if found in the list; otherwise, -1.
Inserts an item to the at the specified index.
The zero-based index at which should be inserted.
The object to insert into the .
Removes the item at the specified index.
The zero-based index of the item to remove.
Gets or sets the element at the specified index.
The index.
Adds an item to the .
The object to add to the .
Sets the last length of the item.
The length.
Removes all items from the .
Determines whether the contains a specific value.
The object to locate in the .
true if is found in the ; otherwise, false.
Copies to.
The array.
Index of the array.
Gets the total length.
The total.
Gets the number of elements contained in the .
The number of elements contained in the .
Gets a value indicating whether the is read-only.
true if the is read-only; otherwise, false.
Removes the first occurrence of a specific object from the .
The object to remove from the .
true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original .
Returns an enumerator that iterates through the collection.
A that can be used to iterate through the collection.
Gets all cached items.
The default pipeline processor
The type of the package info.
Initializes a new instance of the class.
The initializing receive filter.
The max package size.
Processes the input segment.
The input segment.
the processing result
cleanup the cached the buffer by resolving them into one package at the end of the piple line
return the processing result
Gets the received cache.
The cache.
The processing state
The being processed data was processed completely
The being processed data was cached
The processor is in error state
ProtoHandler's base class
Gets the binary data encoder.
The binary data encoder.
Determines whether this instance can send.
Closes the specified channel.
The channel.
The reason.
The receive filter which is designed for the protocol with begin and end mark within each message
The type of the package info.
Initializes a new instance of the class.
The begin mark.
The end mark.
Changes the begin mark.
The begin mark.
Changes the end mark.
The end mark.
Resolves the package binary data to package instance
The received buffer stream.
the resolved package instance
Filters the received data.
The received data.
The length of the rest data after filtering.
the received packageInfo instance
Gets or sets the next receive filter. The next receive filter will be used when the next network data is received.
The next receive filter.
Gets or sets the filter state.
The state.
Resets this receive filter.
This Receive filter is designed for this kind protocol:
each request has fixed count part which splited by a char(byte)
for instance, request is defined like this "#12122#23343#4545456565#343435446#",
because this request is splited into many parts by 5 '#', we can create a Receive filter by CountSpliterRequestFilter((byte)'#', 5)
The type of the package info.
Initializes a new instance of the class.
The spliter.
The spliter count.
Filters the received data.
The received data.
The length of the rest data after filtering.
the received packageInfo instance
Gets or sets the next receive filter. The next receive filter will be used when the next network data is received.
The next receive filter.
Gets the state of the current filter.
The filter state.
Resets this receive filter.
Resolves the package binary data to package instance
The received buffer stream.
the resolved package instance
FixedHeaderReceiveFilter,
it is the Receive filter base for the protocol which define fixed length header and the header contains the request body length,
you can implement your own Receive filter for this kind protocol easily by inheriting this class
The type of the package info.
Gets the size of the header.
The size of the header.
Initializes a new instance of the class.
Size of the header.
Gets the body length from header.
The received buffer stream.
The length of the header.
Determines whether this instance [can resolve package] the specified package data.
The received buffer stream.
true if this instance [can resolve package] the specified package data; otherwise, false.
Resets this receive filters.
The receive filter which is designed for the protocol all messages are in the same fixed size
The type of the package info.
The total size of the package the receive filter should receive
Initializes a new instance of the class.
The size.
Filters the received data.
The received data.
The length of the rest data after filtering.
the received packageInfo instance
Gets or sets the next receive filter which will be used when the next network data is received.
The next receive filter.
Gets/sets the state of the current filter.
The filter state.
Resets the size.
The new size.
Resets this receive filter.
Determines whether this instance [can resolve package] the specified package data.
The received buffer stream.
true if this instance [can resolve package] the specified package data; otherwise, false.
Resolves the package binary data to package instance
The received buffer stream.
the resolved package instance
SearchMarkState
Initializes a new instance of the class.
The mark.
Gets the mark.
Gets or sets whether matched already.
The matched.
Changes the search mark.
The mark.
Statefull search util class
Search target from source.
The source.
The target.
The pos.
The length.
Searches the mark from source.
The source.
The mark.
Length of the parsed.
Searches the mark from source.
The source.
The mark.
Searches the mark from source.
The source.
The offset.
The length.
The mark.
Searches the mark from source.
The source.
The offset.
The length.
The mark.
Length of the parsed.
Searches the mark from source.
The source.
The offset.
The length.
The mark.
The matched.
Searches the mark from source.
The source.
The offset.
The length.
The mark.
The matched.
Length of the parsed.
Searches the mark from source.
The source.
The offset.
The length.
State of the search.
Length of the parsed.
Startses the with.
The source.
The mark.
Startses the with.
The source.
The offset.
The length.
The mark.
Endses the with.
The source.
The mark.
Endses the with.
The source.
The offset.
The length.
The mark.
Clones the elements in the specific range.
The source.
The offset.
The length.
The receive filter which is designed for the protocol whose messages must have a same terminator
The type of the package info.
Gets the state of the search.
The state of the search.
The null package info
Initializes a new instance of the class.
The terminator.
Filters the received data.
The received data.
The length of the rest data after filtering.
the received packageInfo instance
Resolves the package binary data to package instance
The received buffer stream.
the resolved package instance
Gets/sets the next receive filter which will be used when the next network data is received
The next receive filter.
Gets or sets the filter state.
The state.
Resets this filter.
String package info class
Gets the key.
The key.
Gets the body.
The body.
Gets the parameters.
The parameters.
Initializes a new instance of the class.
Initializes a new instance of the class.
The key.
The body.
The parameters.
Initializes a new instance of the class.
The source.
The source parser.
Initializes the string package's data.
The source string.
The source parser.
Gets the first param.
Gets the at the specified index.