Introduction

Manual Last Updated 05/04/2008. See readme.txt for the current version number. RakNet is a free to low cost C++ UDP based network library designed to allow programmers to add response time-critical network capabilities to their applications. It is mostly used for games, but is application independent. RakNet is designed for speed, ease of use, application independence, platform independence, and feature set.

Quick Start

Introduction System Overview Detailed Implementation Tutorial Compiler Setup

Training Videos

Introduction:Major Features Tutorial 1: Hello World Tutorial 2: RPC3 Tutorial 3: Replica Manager 2

The Basics

Connecting - How to find and connect to other systems, and what to do if there are problems Creating Packets - How to create custom packets using structures and bitstreams, and how to encode timestamps. Sending Packets - How to send packets already prepared, and what parameters to use. Receiving Packets - How to converting raw data back to a packet you can read via a structure or bitstream. SystemAddress - Describes the purpose and use of the SystemAddress structure used in packets and in some function parameters. Bitstreams - An overview of RakNet's bitstream class, used throughout the API. Reliability types - Covers parameters you can use to control how data gets sent. Network Messages - Gives an overview of the messages the API will send to the user. This is also listed in MessageIdentifiers.h. Timestamping your packets - Covers the purpose of timestamps. NetworkIDObject - A Utility class to give each class instance a unique identifier that all systems can share. Statistics - The statistics that RakNet provides. Secure connections - How to activate and use secure connections. Remote Procedure Calls - How to call functions on remote computers, avoiding the necessity of manually creating packets. Data compression - Provides an overview of RakNet's ability to compress network data. Preprocessor Directives - Enables you to rebuild the library with different code settings. Network Simulator - Purposely drop and lag packets to see how your game holds up under bad network conditions. Custom Memory Management - For consoles, memory tracking, etc.

Plugins

Plugin Interface - The base class of all plugins Autopatcher - Overview of the autopatcher included with RakNet. RPC3 - Call C and C++ functions with native parameter lists, using Boost for additional functionality (newer). AutoRPC - Call C and C++ functions with native parameter lists, using assembly for basic functionality (older). Connection Graph - A plugin-in that maintains a graph of the entire network. Directory Delta Transfer - Send changed or missing files between directories. In essence, a simple autopatcher that can be used for transmitting levels, skins, etc. File List Transfer - Plugin to send a list of files, encoded in the FileList structure Fully Connected Mesh - A plug-in to make all peers connect to all other peers automatically. Lightweight Database Client / Lightweight Database Server - A simple flat database included with RakNet, useful as a directory server to list games. Lobby Client / Lobby Server - Complete lobby solution, with support for friends, emails, messaging, and rooms. Message Filter - Prevent unwanted network messages based on sender for added security. NAT punch-through - How to use the master server and master client for NAT Punch-through. Packet Logger - Print network traffic to the screen, file, or elsewhere. RakVoice - Overview of RakVoice. Refer to RakVoice.h for full implementation and function details. Ready Event - Synchronize when a group of systems are all ready on a common identifier, useful in peer to peer enviroments to start games at the same time, or progress turns in a turn based game. Replica Manager 2 - A plug-in that provides management for your game objects and players to make serialization, scoping, and object creation and destruction easier. Router - Send network messages to one or more remote systems we are not directly connected to.

Utilities

Crash Reporter - Sends mini-dumps when your application crashes, writing to disk and/or sending an email. Console Server - Text based backdoor to a server using either secure RakNet or telnet, allowing execution of predesignated commands or arbitrary command strings. Email Sender - Used by the crash reporter to send emails via TCP String Compressor / String Table - Used to encode strings with less bandwidth and more security. TCP Interface - Wrapper class for TCP connections PHP Directory Server - List games on a webpage from or to C++

3D Demos

Ogre 3D Interpolation Demo - Use Ogre 3D to show a demo of popping popcorn over a client/server network, using ReplicaManager2

Data Structures

DS_BinarySearchTree.h - Binary search tree, and an AVL balanced binary search tree. DS_BPlusTree.h - BPlus tree for fast lookup, delete, and insert. DS_BytePool.h - Returns data blocks at certain size thresholds to reduce memory fragmentation. DS_ByteQueue.h - A queue specialized for reading and writing bytes. DS_Heap.h - Heap data structure, includes both minheap and maxheap. DS_HuffmanEncodingTree.h - Huffman encoding tree, used to find the minimal bitwise representation given a frequency table. DS_HuffmanEncodingTreeFactory.h - Creates instances of the Huffman encoding tree. DS_HuffmanEncodingTreeNode.h - Node in the Huffman encoding tree. DS_LinkedList.h - Standard linked list. DS_List.h - Dynamic array (sometimes improperly called a vector). Also doubles as a stack. DS_Map.h - (Associative array) Ordered list with an per-element sort key. DS_MemoryPool.h - Allocate and free reused instances of a fixed size structure, used to reduce memory fragmentation. DS_OrderedChannelHeap.h - Maxheap which returns a node based on the relative weight of the node's associated channel. Used for task scheduling with priorities. DS_OrderedList.h - List ordered by an arbitrary key via quicksort. DS_Queue.h - Standard queue implemented with an array DS_QueueLinkedList.h - Standard queue implemented with a linked list DS_RangeList.h - Stores a list of numerical values, and when the values are sequential, represents them as a range rather than individual elements. Useful when storing many values that are usually sequential. DS_Table.h - Table with columns and rows, and operations on that table. DS_Tree.h - Noncyclic graph DS_WeightedGraph.h - Graph with weighted edges, used for routing via Dijkstra's algorithm RakString - String implementation, up to 4.5 times faster than std::string

Support

FAQ Programming Tips Revision Log Forum Email Author