So I have searched for a way to make this work but found no working solution. I am trying to send text that has been inserted in to a memo from the Client to the Server using sockets. Unfortunately I cannot get the coding working. It might be something stupid I'm doing wrong; but I don't know where the mistake is. I created a stable connection between the server and client, and I am able to send text using Server.Socket.Connections[Form1.ListView1. I Pilastri Della Terra Pdf To Jpg more. Selected.Index].SendText('Texthere'); but I just cant get it to send and receive text or anything using buffers. It seems you have completely ignored all of the code I gave you in your.
Professional set of Delphi and C++Builder components for virtual instrumentation. Meters, Bars (Gauge), with linear or log(10) scaling; Digital indicators (time, value). Virtual Treeview is a treeview control built from ground up. More than a decade of development made it one of the most flexible and advanced Delphi tree controls.
You are still not taking into account that Send.() and Receive.() can send/read partial data that must be buffered, or that received data can span across multiple OnRead events and so must be buffered as well. And you are not doing any error handling on the sends/reads. I gave you a complete buffering solution earlier, but I don't see any trace of it in this code. Rewriting your code to send/read a stream does not change the fundamental rules.
– Nov 29 '14 at 17:29. I've just make a very-very simple example of TCP client and server on Indy. It is very simple, even no exceptions handling there. Take a look at and feel free to ask any questions. Anyway, using of native socket components is not a good idea. Try to study Indy, then Synapse or mORMot may be. Indy will be a good start.
UPD I'll try to get some code here in answer: Start a TCP server listening on specified port: var IdTcpServer1: TIdTcpServer [.] IdTcpServer1.DefaultPort:= SERVER_PORT; IdTcpServer1.Active:= True; Server will start listening on 0.0.0.0:1234. Connect a TCP client to TCP server: var IdTcpClient1: TIdTcpClient; [.] IdTcpClient1.Host:= SERVER_HOST; // IP or DNS name IdTcpClient1.Port:= SERVER_PORT; IdTcpClient1.Connect; Send a text line to socket (after it's connected): IdTcpClient1.IOHandler.Writeln('Hello world!'
); Server must implement OnExecute event handler: // manual init in code or you can assign it in design-time in IDE IdTcpServer1.OnExecute:= IdTcpServer1ExecuteHandler; [.] // very simple example procedure IdTcpServer1ExecuteHandler(AContext: TIdContext); var s: string; begin s:= AContext. Vw Transporter T4 Workshop Manual Pdf. Connection.IOHandler.ReadLn(); if s EmptyStr then begin // do something with received string s end; end.