Delphi TServerSocket/ClientSocket 发送接收消息问题请教
服务器端通过WriteLn方法发送字符串,客户端通过ReadLn接收消息的时候弹出了异常信息:classEIdReadLnMaxLineLengthExceededWIT...
服务器端通过WriteLn方法发送字符串,客户端通过ReadLn接收消息的时候弹出了异常信息:class
EIdReadLnMaxLineLengthExceeded WITH message 'max line length exceeded'
好像是接收的信息超过了大小
请问大家有什么好办法处理吗?谢谢 展开
EIdReadLnMaxLineLengthExceeded WITH message 'max line length exceeded'
好像是接收的信息超过了大小
请问大家有什么好办法处理吗?谢谢 展开
2个回答
展开全部
Procedure TForm1.BitBtn1Click(Sender: TObject);
var
I: Integer;
Begin
for I := 0 to ServerSocket1.Socket.ActiveConnections -1 Do
Begin
//if ServerSocket1.Socket.Connections[I].SocketHandle = XXX then
ServerSocket1.Socket.Connections[I].SendText('amsg'); //服务端发送
End;
End;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
Socket.ReceiveText; //客户端接收
end;
var
I: Integer;
Begin
for I := 0 to ServerSocket1.Socket.ActiveConnections -1 Do
Begin
//if ServerSocket1.Socket.Connections[I].SocketHandle = XXX then
ServerSocket1.Socket.Connections[I].SendText('amsg'); //服务端发送
End;
End;
procedure TForm1.ClientSocket1Read(Sender: TObject;
Socket: TCustomWinSocket);
begin
Socket.ReceiveText; //客户端接收
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询