阿
阿蛮
Unregistered / Unconfirmed
GUEST, unregistred user!
我用TcpClient控件发送与接收,每次正常收到3次左右以后,就总是返回上一次收到的数据,我怎样才能清空它的缓冲区呢?
我的代码如下:
function SendData(s: String): String;
var
st: TStringStream;
buf: array[0..8192] of char;
begin
St:=TStringStream.Create(s+#13);
frmDM.TcpClient.SendStream(St);
frmMain.TcpClient.ReceiveBuf(buf, Length(buf), 0);
result:=Trim(r);
end;
我的代码如下:
function SendData(s: String): String;
var
st: TStringStream;
buf: array[0..8192] of char;
begin
St:=TStringStream.Create(s+#13);
frmDM.TcpClient.SendStream(St);
frmMain.TcpClient.ReceiveBuf(buf, Length(buf), 0);
result:=Trim(r);
end;