RakNet framework
来源:互联网 发布:手机办公必备软件 编辑:程序博客网 时间:2024/05/21 09:48
1. network communication, plugins that use network communication, and general game functionality.
1) Network communication
+ RakPeerInterface
- based on UDP, The primary class
- connections, connection management
- congestion control, remote server detection
- out of band messaging
- connection statistics
- latency and packetloss simulation
- secure connectivity
+ TCPInterface
- a wrapper for TCP
- communicate with external systems based on the TCP.
2) Plugins
+ an instance of RakPeer or PacketizedTCP
+ uses chain of responsibility design pattern
+ host determination
+ file transfers
+ NAT traversal
+ voice communication
+ remote procedure calls
+ game object replication
3) RakPeer
+ the base functionality for UDP communication
+ two threads
- wait for incoming datagrams
- perform periodic updates, such as determing lost connections, pings
- a Remote System structure
- contains a class to manage congestion control
- Connections are identified by SystemAddress or RakNetGuid
- established through UDP messages, (a connection request payload & an 'offline message' identifier)
+ a connection requests arrives
- RakPeer transmits internal state data
- checks this connection
- repeat connection list, security measures
- ID_CONNECTION_REQUEST_ACCEPTED, or ID_NEW_INCOMING_CONNECTION
+ Outgoing messages
- larger than the MTU, fragmented internally
- Messages are sent in order of priority.
- resends taking priority over new sends
+ incoming datagrams
- using a blocking recvfrom thread
- recorded timestamp
- pushed a thread-safe queue
- processed through the ReliabilityLayer class
- congestion control
- ACKS, NAKS, resends, encryption, reassembly of large messages
+ Connected messages are first processed
+ Calling RakPeer::Receive() to process one message
- Message returned to the user are returned from RakPeer::Receive()
- to call Receive() in a loop to get all messages
4) NetworkIDObject
+ remote function calls
+ the ability for systems to refer to common objects
+ a 64 bit random number assigned
- be used to lookup pointers through a hash
5) SystemAddress struct
+ to represent remote systems
+ encoding of the IP address along with the port
6) BitStream class
+ write single bits to a stream
+ automatic endian swapping
+ be enabled by commenting out __BITSTREAM_NATIVE_END in RakNetDefines.h
7) the architecture UML
+ file:///home/xxxx/devdir/raknet/RakNet-master/Help/RakNetUML.jpg
2. how to start
1) Get one instance
RakNet::RakPeerInterface* peer = RakNet::RakPeerInterface::GetInstance();
2) Connect as client
peer->Startup(1, &SocketDescriptor(), 1)
peer->Connect(serverIP, serverPort, 0, 0);
(not finish, will continue...)
0 0
- RakNet framework
- RakNet
- RakNet学习(1)--RakNet
- RakNet学习
- raknet unity3d
- (转)RakNet
- raknet编译
- 一日一点RakNet(1)--RakNet
- 一日一点RakNet(1)--RakNet
- RakNet的配置
- RakNet RPC3 & NetworkIDManager
- RakNet linux编译
- 1.RakNet工程设置
- Raknet 全部系列下载
- RakNet 消息、函数注册
- linux下编译raknet
- RakNet学习(3) -- 介绍
- RakNet学习 (9) -- Startup
- Android 服务器之更新
- imageView scaleType的值 各种解释
- 使用FastReport-v5.3.17把fp3文件转为excel文件
- modal
- java读取大文件(分割)
- RakNet framework
- Jenkins环境搭建
- 支付宝支付接口对接的总结
- 获取资源管理器路径
- 安卓简单开发-Edittext限制输入文本
- ubuntu中拷贝文件到当前文件夹
- android预置apk,覆盖原生apk总结
- Java 下的 JSON库性能比较:JSON.simple vs. GSON vs. Jackson vs. JSONP
- EventBus使用详解