You commented out the SendStr in the server.
That's the line that sends Ok back to the client.
i commented out because it added the line every second, how can i make it added just once?
Look again at this code:
buffer := edit3.text;//'hello, this is a client';
repeat
sock.SendString(buffer + CRLF);
buffer := sock.RecvPacket(2000);
memo1.lines.add(buffer);
until buffer = '';
It will put your text in buffer.
After that it TRIES to receive a string from the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
If you uncommented that Ok line you'll receive Ok straight away.
Directly after that you AGAIN send the buffer to the server.
So why are you sending the same test (in buffer) over and over again?
No wonder you get Ok from the server each second because you send that buffer each second.