-
Notifications
You must be signed in to change notification settings - Fork 0
bf693aca 19e1 55db 1b2d 6bee6d5279c0
Arthur Frederico Neves edited this page Jul 19, 2016
·
6 revisions
Is the basic unit of the network communication, in other words all the information that travels over the network is converted in BasePack before transmission and is subsequently reassembled by the receiver. It simplifies operations with the network buffer and handle reading and writing.
System.Object
NETLIB.BasePack
Namespace: NETLIB
Assembly: NETLIB (in NETLIB.dll) Version: 1.0.0.0 (1.0.0.0)
C#
public class BasePack
VB
Public Class BasePack
C++
public ref class BasePack
F#
type BasePack = class end
The BasePack type exposes the following members.
Name | Description | |
---|---|---|
![]() |
BasePack() | Initialize the inner buffer with packSize |
![]() |
BasePack(Byte[]) | Initialize the BasePack taking buffer as your own inner buffer |
![]() |
BasePack(BasePack) | Takes the basePack inner buffer as its own inner beffer. The readPosition and the writePosition are not copied |
Name | Description | |
---|---|---|
![]() |
Buffer | Returns the inner buffer but deny the exchange of buffer reference. |
![]() |
ID | Used by IOPackHandler(TPack) to classify and redirect incoming packs to the proper handle function. Refers to the first byte of the buffer. |
![]() |
Item | Make the buffer's data public but deny the exchange of buffer reference. |
![]() |
Length | Length of the inner buffer. |
![]() |
ReadPosition | Gets and sets the readPosition. |
![]() |
WritePosition | Gets and sets the writePosition. |
Name | Description | |
---|---|---|
![]() |
DeepCopy | Makes a deep copy of the pack, by cloning the internal buffer for the new package. |
![]() |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() |
GetBool() | Converts a part of the inner buffer, started in readPosition, to a bool. |
![]() |
GetBool(Int32) | Converts a part of the inner buffer, started in readPosition, to a bool. |
![]() |
GetByte() | Converts a part of the inner buffer, started in readPosition, to a byte. |
![]() |
GetByte(Int32) | Converts a part of the inner buffer, started in readPosition, to a byte. |
![]() |
GetChar() | Converts a part of the inner buffer, started in readPosition, to a char. |
![]() |
GetChar(Int32) | Converts a part of the inner buffer, started in readPosition, to a char. |
![]() |
GetDouble() | Converts a part of the inner buffer, started in readPosition, to a double. |
![]() |
GetDouble(Int32) | Converts a part of the inner buffer, started in readPosition, to a double. |
![]() |
GetFloat() | Converts a part of the inner buffer, started in readPosition, to a float. |
![]() |
GetFloat(Int32) | Converts a part of the inner buffer, started in readPosition, to a float. |
![]() |
GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() |
GetInt() | Converts a part of the inner buffer, started in readPosition, to a int. |
![]() |
GetInt(Int32) | Converts a part of the inner buffer, started in readPosition, to a int. |
![]() |
GetPackable(CustomType) | Converts a part of the inner buffer, started in readPosition, to a CustomType. |
![]() |
GetString() | Converts a part of the inner buffer, started in readPosition, to a string. |
![]() |
GetString(Int32) | Converts a part of the inner buffer, started in readPosition, to a string. |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() |
PutBool(Boolean) | Converts a bool to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutBool(Boolean, Int32) | Converts a bool to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutByte(Byte) | Converts a byte to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutByte(Byte, Int32) | Converts a byte to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutChar(Char) | Converts a char to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutChar(Char, Int32) | Converts a char to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutDouble(Double) | Converts a double to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutDouble(Double, Int32) | Converts a double to a byte buffer and put in the inner buffer, started in offset. |
![]() |
PutFloat(Single) | Converts a float to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutFloat(Single, Int32) | Converts a float to a byte buffer and put in the inner buffer, started in offset. |
![]() |
PutInt(Int32) | Converts a int to a byte buffer and put in the inner buffer, started in writePosition |
![]() |
PutInt(Int32, Int32) | Converts a int to a byte buffer and put in the inner buffer, started in offset. |
![]() |
PutPackable(CustomType) | Converts a CustomType class that implemets Ipackable to a byte buffet and put in the inner buffer, started in writePosition |
![]() |
PutString(String) | Converts a string to a byte buffer and put in the inner buffer, started in writePosition. |
![]() |
PutString(String, Int32) | Converts a string to a byte buffer and put in the inner buffer, started in offset. |
![]() |
Read | Copies a sequence of bytes from the pack and advances the current readPosition by the number of bytes copied. |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() |
Write | Copies a sequence of bytes to the pack and advances the current writePosition by the number of bytes copied. |
Name | Description | |
---|---|---|
![]() ![]() |
Implicit(Byte[] to BasePack) | Initialize and returns a new BasePack using buffer as it's inner buffer. |
Name | Description | |
---|---|---|
![]() |
buffer | Hold the pack information. Used by Publisher to send the information |
![]() ![]() |
packSize | Represent the maximum size of the network buffer. The pack buffer will never be bigger than this. Used by Publisher to receive the network buffer |
![]() |
readPosition | Stores the index to be used in the buffer for the next read. |
![]() |
writePosition | Stores the index to be used in the buffer for the next write. |
The following code example shows how to create a new pack, put and get some fields from there.
void Example()
{
int d1 = 5;
int d2 = 6;
int c1;
int c2;
BasePack newPack = new BasePack();
newPack.ID = 10;
newPack.PutInt(d1);
newPack.PutInt(d2);
c1 = newPack.GetInt();
c2 = newPack.GetInt();
}
A Sandcastle Documented Class Library
Send comments on this topic to [](mailto:?Subject=A Sandcastle Documented Class Library)
-
NETLIB Namespace
-
BasePack Class
- BasePack Constructor
- BasePack Properties
-
BasePack Methods
- BasePack.DeepCopy Method
- BasePack.GetBool Method
- BasePack.GetByte Method
- BasePack.GetChar Method
- BasePack.GetDouble Method
- BasePack.GetFloat Method
- BasePack.GetInt Method
- BasePack.GetPackable(CustomType) Method
- BasePack.GetString Method
- BasePack.PutBool Method
- BasePack.PutByte Method
- BasePack.PutChar Method
- BasePack.PutDouble Method
- BasePack.PutFloat Method
- BasePack.PutInt Method
- BasePack.PutPackable(CustomType) Method
- BasePack.PutString Method
- BasePack.Read Method
- BasePack.Write Method
- BasePack Type Conversions
- BasePack Fields
- ConnectionClosedEventHandler Delegate
- ConnectionClosedEventHandler(Type) Delegate
- ConnectionClosedException Class
-
Consumer(TPack) Class
- Consumer(TPack) Constructor
- Consumer(TPack) Properties
-
Consumer(TPack) Methods
- Consumer(TPack).CloseConnection Method
- Consumer(TPack).Dispose Method
- Consumer(TPack).EndConsume Method
- Consumer(TPack).EndPublishConsume Method
- Consumer(TPack).Finalize Method
- Consumer(TPack).OnReceivedPackCall Method
- Consumer(TPack).PackFactory Method
- Consumer(TPack).SendPack Method
- Consumer(TPack).Start Method
- Consumer(TPack).StartConsume Method
- Consumer(TPack) Events
- ConsumerRunningException Class
- IOBasePackHandler Class
- IOPackHandler(TPack) Class
- IPackable Interface
- ListenerRunnigException Class
- Protocol(TPack) Class
-
Publisher Class
- Publisher Constructor
- Publisher Properties
- Publisher Methods
- Publisher Events
- Publisher Fields
- PublisherRunnigException Class
- ThrowPackEventHandler(TPack) Delegate
-
BasePack Class
- NETLIB.TCP Namespace
- NETLIB.TCP.Server Namespace