W
wmhnq
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大哥,我用SOCKET写的聊天的服务器端,当有数据重客户端发送到服务器端的时候就转发给每个客户端,但是下面这段我不知道哪里错了,我知道肯定大错特错了,老大们,帮帮我呀。
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var i:integer;
begin
if serversocket1.Socket.ActiveConnections=0 then exit;
for i:=0 to serversocket1.Socket.ActiveConnections-1 do
begin
serversocket1.Socket.Connections.SendText(socket.ReceiveText);
end;
end;
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var i:integer;
begin
if serversocket1.Socket.ActiveConnections=0 then exit;
for i:=0 to serversocket1.Socket.ActiveConnections-1 do
begin
serversocket1.Socket.Connections.SendText(socket.ReceiveText);
end;
end;