Extract BBC News from BFBS stream.
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 1m10s

This commit is contained in:
feyris-tan 2025-11-13 22:24:37 +01:00
parent 4786e9865c
commit eb2ceb5f72

View File

@ -111,9 +111,11 @@ namespace skyscraper8.Skyscraper
return true; return true;
} }
private bool sucessfulPass;
public void HandlePacket(InternetHeader internetHeader, byte[] ipv4Packet) public void HandlePacket(InternetHeader internetHeader, byte[] ipv4Packet)
{ {
sucessfulPass = false;
UserDatagram userDatagram = new UserDatagram(ipv4Packet); UserDatagram userDatagram = new UserDatagram(ipv4Packet);
IPEndPoint source = new IPEndPoint(internetHeader.SourceAddress, userDatagram.SourcePort); IPEndPoint source = new IPEndPoint(internetHeader.SourceAddress, userDatagram.SourcePort);
IPEndPoint target = new IPEndPoint(internetHeader.DestinationAddress, userDatagram.DestinationPort); IPEndPoint target = new IPEndPoint(internetHeader.DestinationAddress, userDatagram.DestinationPort);
@ -125,12 +127,39 @@ namespace skyscraper8.Skyscraper
if (ms.ReadUInt8() != 0x10) if (ms.ReadUInt8() != 0x10)
return; return;
throw new NotImplementedException(); if (sessions == null)
sessions = new List<Session>();
Session session = sessions.Find(x => x.SourceAddress.Equals(source) && x.TargetAddress.Equals(target));
if (session != null)
{
if (session.ContinuityCounter >= 3)
{
while (ms.GetAvailableBytes() >= 188)
{
byte[] readBytes = ms.ReadBytes(188);
subTsHandler.OnSubTsPacket(session, readBytes);
sucessfulPass = true;
}
return;
}
else
{
session.Touch(sequence);
return;
}
}
else
{
session = new Session(source, target, sequence);
sessions.Add(session);
return;
}
} }
public bool StopProcessingAfterThis() public bool StopProcessingAfterThis()
{ {
throw new NotImplementedException(); return sucessfulPass;
} }
} }
} }