MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / rawHandler

Method rawHandler

MonaCore/sources/FlashMainStream.cpp:167–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void FlashMainStream::rawHandler(UInt16 type,PacketReader& packet,FlashWriter& writer) {
168
169 // setBufferTime
170 if(type==0x0003) {
171 UInt16 streamId = packet.read32();
172 if(streamId==0) {
173 bufferTime(packet.read32());
174 return;
175 }
176 const auto& it = _streams.find(streamId);
177 if (it==_streams.end()) {
178 ERROR("setBufferTime message for an unknown ",streamId," stream")
179 return;
180 }
181 it->second->bufferTime(packet.read32());
182 return;
183 }
184
185
186 // ping message
187 if(type==0x0006) {
188 writer.writePong(packet.read32());
189 return;
190 }
191
192 // pong message
193 if(type==0x0007) {
194 peer.pong();
195 return;
196 }
197
198 ERROR("Raw message ",Format<UInt16>("%.4x",type)," unknown on main stream");
199}
200
201
202

Callers

nothing calls this directly

Calls 6

read32Method · 0.80
pongMethod · 0.80
findMethod · 0.45
endMethod · 0.45
bufferTimeMethod · 0.45
writePongMethod · 0.45

Tested by

no test coverage detected