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

Method sendPacket

Engine/source/sim/netConnection.cpp:868–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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