服务端 : 
   得用多线程:
constructor TActionThread.create (whatin:integer;socketin:TCustomWinSocket;indexin:integer);
begin
   what:=whatin;
   socket:=socketin;
   index:=indexin;
   inherited Create(False);
end;procedure TActionThread.Action(index:integer;socket:TCustomWinSocket;index:integer);
 { }procedure TActionThread.Execute;
begin
   Action(index,socket,index);
end;I hope that it is helpful !!

解决方案 »

  1.   

    //packets[a, b, ClientIndex]; //多开辟一个空间procedure TFormSocket.ServerSocket1ClientRead(Sender: TObject;
      Socket: TCustomWinSocket);
    begin
      //根据Socket.RemoteAddress你可以知道是谁发送来的
      //再开辟不同的缓冲来存放不同的数据
      //和一对一其实没有多大区别
    end;
      

  2.   

    为每个连接建立一个SESSION KEY,这样就可以表示数据从哪里来了。
    用IP地址来判断不好,因为一台机器上可以开几个程序来和服务器连的
      

  3.   

    suiyi_518(suiyi)  代码中 的 Action(index,socket,index); 是否要同步调用处理,否则不会有多线程的效果吧。