| 165 | } |
| 166 | |
| 167 | void 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 | |