MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / sendPacket

Method sendPacket

Engine/source/sim/netConnection.cpp:863–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

861}
862
863Net::Error NetConnection::sendPacket(BitStream *stream)
864{
865 //Con::printf("NET %d: SEND - %d", getId(), mLastSendSeq);
866 // do nothing on send if this is a demo replay.
867 if(mDemoReadStream)
868 return Net::NoError;
869
870 gNetBitsSent = stream->getPosition();
871
872 if(isLocalConnection())
873 {
874 // short circuit connection to the other side.
875 // handle the packet, then force a notify.
876 stream->setBuffer(stream->getBuffer(), stream->getPosition(), stream->getPosition());
877 mRemoteConnection->processRawPacket(stream);
878
879 return Net::NoError;
880 }
881 else
882 {
883 return Net::sendto(getNetAddress(), stream->getBuffer(), stream->getPosition());
884 }
885}
886
887//--------------------------------------------------------------------
888//--------------------------------------------------------------------

Callers 1

processMethod · 0.80

Calls 4

getPositionMethod · 0.45
setBufferMethod · 0.45
getBufferMethod · 0.45
processRawPacketMethod · 0.45

Tested by

no test coverage detected