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
Buf: Array[1..2048] of char;