这是我的Send函数,不要用stream,用array of byte就可以了,这样速度快,不十分占用资源
type
TSendData = array [0..UDP_POCKET_SIZE - 1 + RTP_POCKET_HEADER] of Byte;
// TCP发送数据包
procedure TcpWriteBuffer(const ABuf: TSendData; const AByteCount: Integer);
begin
try
if Assigned(FTcpSocket) then
FTcpSocket.WriteBuffer(ABuf, AByteCount, True);
except
on A: EIdSocketError do ;
on E: Exception do raise;
end;
end;