Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nxrighthere authored Sep 14, 2018
1 parent e3be631 commit 6074704
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ FreeCallback OnMemoryFree = (memory) => {
Marshal.FreeHGlobal(memory);
};

OutOfMemoryCallback OnOutOfMemory = () => {
NoMemoryCallback OnNoMemory = () => {
throw new OutOfMemoryException();
};

Callbacks callbacks = new Callbacks(OnMemoryAllocate, OnMemoryFree, OnOutOfMemory);
Callbacks callbacks = new Callbacks(OnMemoryAllocate, OnMemoryFree, OnNoMemory);

if (ENet.Library.Initialize(callbacks) > -1)
Console.WriteLine("ENet successfully initialized using a custom memory allocator");
Expand Down Expand Up @@ -220,6 +220,8 @@ Contains a managed pointer to the packet.

`Packet.Length` returns a length of payload in the packet.

`Packet.SetFreeCallback(PacketFreeCallback callback)` set callback to notify the user when an appropriate packet is being destroyed.

`Packet.Create(byte[] data, int length, PacketFlags flags)` creates a packet that may be sent to a peer. The length and flags parameters are optional. Multiple flags can be specified at once.

`Packet.CopyTo(byte[] destination)` copies payload from the packet to the destination array.
Expand Down

0 comments on commit 6074704

Please sign in to comment.