Y
yihui
Unregistered / Unconfirmed
GUEST, unregistred user!
在一个用serversocket和clientsocket的TCP/IP程序中
Server端ServerSocket.Socket.Connections[0].SendText(SomeString)
procedure TfrmMain.SendCmnd(CmndStr:string);
begin
serversocket.Socket.Connections[0].SendText(CmndStr);
end;
client端Socket.ReceiveText,根据接收的string不同执行不同的操作:
procedure TfrmMain.ClientSocketRead(Sender: TObject;
Socket: TCustomWinSocket);
var RcvTxt:string;
begin
RcvTxt:=Socket.ReceiveText;
if RcvTxt='CmndString1' then
begin
...
end;
if RcvTxt='CmndString2' then
begin
...
end;
...
end;
Server端执行SendCmnd()一次或几次执行的间隔时间大些,则在client端程序正常,
但是如果执行
...
SendCmnd(command1);
SendCmnd(command2);
SendCmnd(command3);
SendCmnd(command4);
...
那么Client端的程序就不正常了.如何解决?
Server端ServerSocket.Socket.Connections[0].SendText(SomeString)
procedure TfrmMain.SendCmnd(CmndStr:string);
begin
serversocket.Socket.Connections[0].SendText(CmndStr);
end;
client端Socket.ReceiveText,根据接收的string不同执行不同的操作:
procedure TfrmMain.ClientSocketRead(Sender: TObject;
Socket: TCustomWinSocket);
var RcvTxt:string;
begin
RcvTxt:=Socket.ReceiveText;
if RcvTxt='CmndString1' then
begin
...
end;
if RcvTxt='CmndString2' then
begin
...
end;
...
end;
Server端执行SendCmnd()一次或几次执行的间隔时间大些,则在client端程序正常,
但是如果执行
...
SendCmnd(command1);
SendCmnd(command2);
SendCmnd(command3);
SendCmnd(command4);
...
那么Client端的程序就不正常了.如何解决?