#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Client send message to another client in my chat program please help?


    hi everybody i am new user in this forum and i can little speak english i have a problem i want creat chat program . i want client send message to another client in my program and client connect random to another client ? how do i do it ?

    i am use tcilentsocket and tserversocket
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0
    Originally Posted by hakanharbeli
    hi everybody i am new user in this forum and i can little speak english i have a problem i want creat chat program . i want client send message to another client in my program and client connect random to another client ? how do i do it ?

    i am use tcilentsocket and tserversocket
    hi my friend,
    teste with this order
    ***************************
    to send message use:

    procedure TForm1.Button3Click(Sender: TObject);
    begin
    memo1.Lines.Add(''+edit2.Text+'>'+memo2.Text);
    memo2.Clear;
    clientsocket1.Socket.SendText(memo1.text);
    clientsocket1.Socket.SendText(clientsocket1.Address);
    end;
    *****************
    to Receive messsage use:

    ***********
    procedure TForm1.ClientSocket1Read(Sender: TObject;
    Socket: TCustomWinSocket);
    begin
    edit3.Text:=socket.ReceiveText;
    end;
    ******************************
    the same in server.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0
    thank you for write but client send message to server and server send to other client this message how do i do ?

    i think your is in answer client direct send to message other client i want client send to message by server i hope you are understand me

    i want creat mutli chat program and clients are private messaging to other clients
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0
    I think what you are looking for is a to create a server application and client application. the server must be running somewhere and always listening for incoming connections.

    When it receives one, it would determine who the message is for, then send it on to that person.

    the clients would also always be listening for incoming messages.

    to accomplish this, you will need a way of identifying who is supposed to get the messages. this also means you will need a database of people, and the IP address they are connecting from.

    I am curious what you are trying to do with this since it is already available in so many different forms.

IMN logo majestic logo threadwatch logo seochat tools logo