MCPcopy Create free account
hub / github.com/cocos/cocos-engine / send

Method send

native/cocos/network/SocketIO.cpp:609–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609void SIOClientImpl::send(const ccstd::string &endpoint, const ccstd::string &s) {
610 switch (_version) {
611 case SocketIOPacket::SocketIOVersion::V09X: {
612 SocketIOPacket *packet = SocketIOPacket::createPacketWithType("message", _version);
613 packet->setEndpoint(endpoint);
614 packet->addData(s);
615 this->send(packet);
616 delete packet;
617 break;
618 }
619 case SocketIOPacket::SocketIOVersion::V10X: {
620 this->emit(endpoint, "message", s);
621 break;
622 }
623 }
624}
625
626void SIOClientImpl::send(SocketIOPacket *packet) {
627 ccstd::string req = packet->toString();

Callers 15

connectToEndpointMethod · 0.95
heartbeatMethod · 0.95
emitMethod · 0.95
onGenerateConfirmFunction · 0.45
readyFunction · 0.45
resetMultiObjectSizeFunction · 0.45
recalculateBoundsFunction · 0.45
resetObjectSizeFunction · 0.45
material.jsFile · 0.45
readyFunction · 0.45
updateFunction · 0.45
readyFunction · 0.45

Calls 6

emitMethod · 0.95
setEndpointMethod · 0.80
addDataMethod · 0.80
toStringMethod · 0.65
dataMethod · 0.45
onErrorMethod · 0.45

Tested by

no test coverage detected