Das habe ich alles schon mal geschrieben. Da es allerdings schon ein paar Seiten her ist, werde ich es nochmal schreiben.
BytesSent := Client.SendBuffer(SendBuffer.Memory^, Min(SND_RCV_SIZE, SendBuffer.Size))
In dieser Zeile ist der Fehler des SendBuffers.
Delphi-Quellcode:
// Extraction of wavehdrs
IF ReceiveBuffer.Size >= WaveHdr.dwBufferLength THEN BEGIN
Move(ReceiveBuffer.Memory^, WaveHdr.lpData^, WaveHdr.dwBufferLength);
Move(Pointer(Integer(ReceiveBuffer.Memory) + WaveHdr.dwBufferLength)^,ReceiveBuffer.Memory^, ReceiveBuffer.Size - WaveHdr.dwBufferLength);
ReceiveBuffer.Size := ReceiveBuffer.Size - WaveHdr.dwBufferLength;
ReceiveBuffer.Seek(0, soFromEnd);
SendToPlayerThread();
END;
end;
procedure processSendBuffer();
VAR BytesSent: Integer;
begin
IF Assigned(Client) THEN
BytesSent := Client.SendBuffer(SendBuffer.Memory^, Min(SND_RCV_SIZE, SendBuffer.Size))
ELSE BytesSent := Accept.SendBuffer(SendBuffer.Memory^, Min(SND_RCV_SIZE, SendBuffer.Size));
IF BytesSent > 0 THEN BEGIN
Move(Pointer(Integer(SendBuffer.Memory) + BytesSent)^,SendBuffer.Memory^, SendBuffer.Size - BytesSent);
SendBuffer.Size := SendBuffer.Size - BytesSent;
SendBuffer.Seek(0, soFromEnd);
END;
end;
Das ist nochmal der Codeschnipsel, in dem der Fehler war.