Am currently using ICS for a large chat system but now my service is getting 
bigger am starting to worry I not really done the socket code best I can below 
is the server side for receiving string commands also other idea am interested 
in looking into is a main server that controls other servers so can host 
multiple servers around world and main server will link them all and client 
will know were to connect.

procedure TComServer.SocketServerDataAvailable(Sender: TObject; ErrCode: Word);
begin
  with Sender as TWSocketClient do
  begin
     RunCommand(ReceiveStr, Sender as TWSocketClient);
  end;
end;

then the run common would split the string command in there own sections and 
read from array and assign correct string to dat[id]

procedure TComServer.RunCommand(comdata: string; rSocket: TWSocketClient);
var
  command: string;
  dat: array [0..50] of string;
begin
  { INCOMING ENCODED DATA STRING }
  comdata := DecodeStr(comdata);

  { DECODE INCOMING DATA STRING }
  while DecodeCommand(comdata, command, dat) do begin
  case StrToIntDef(command, -1) of
     00: LoginToService(dat[0], rSocket);
   end;
end;

now am starting to think maybe string is not a good way to go about this on a 
large scale service so am wondering if anyone else has ever built a chat system 
and what methods did you use?, any information be great. Thanks a lot

Yours
Simon
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to