The tutorial represents a Delphi program that starts listening to an incoming connection, accepts the connection, receives all data over the established connection, and sends no data back to the client.
This Delphi program represents a mostly simple demos and by no means, a complete application. It's intended to demonstrate how to use the TcpServerConnection socket class from the Clever Internet Suite
library to start listening on the specified local port and receive TCP packets over the Network.
This functionality might be useful when you debug a Network app and want to analyze the produced TCP traffic. You can run the Silent Socket Receiver app and capture the Network packets between the client and the server, e.g. using the Wireshark
utility. In this case your Network app acts as the client, and the Silent Socket Receiver app as the server.
You can even modify the Silent Socket Receiver program to send TCP response back to the connected client.
procedure TForm1.FormCreate(Sender: TObject);
FConnection := TclTcpServerConnection.Create();
procedure TForm1.FormDestroy(Sender: TObject);
procedure TForm1.btnListenClick(Sender: TObject);
FConnection.NetworkStream := TclNetworkStream.Create();
memLog.Lines.Add('=== Start listening ===');
FStarted := True;
FConnection.TimeOut := -1;
data := TMemoryStream.Create();
memLog.Lines.Add('Received bytes: ' + IntToStr(data.Size));
data.Size := 0;
until not FConnection.Active;
on E: EclSocketError do
if ((E.ErrorCode <> 10053) and (E.ErrorCode <> 10038)) then raise;
How to compile: