Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.
authorLoic Blot <loic.blot@unix-experience.fr>
Tue, 31 Mar 2015 08:35:51 +0000 (10:35 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Tue, 31 Mar 2015 09:01:08 +0000 (11:01 +0200)
commit1fe4256462826c218ed9bf171be4c07e0db33e25
tree8c07a04333c23599376327e847d030cfe6bec162
parentab77bf98ee320835e5dc50ed9b013442221f96e8
Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.
Because we get a Buffer<u8> from ConnectionEvent, don't convert it to SharedBuffer<u8> and return it to Server/Client::Receive which will convert it to NetworkPacket
Instead, put the Buffer<u8> directly to NetworkPacket and return it to packet processing
This remove a long existing memory copy
Also check the packet size directly into Connection::Receive instead of packet processing
src/client.cpp
src/client.h
src/network/connection.cpp
src/network/connection.h
src/network/networkpacket.cpp
src/network/networkpacket.h
src/server.cpp
src/server.h
src/test.cpp