Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:50:37+00:00 2026-06-13T00:50:37+00:00

In Delphi XE2, I’m using the TTCPClient component to communicate with an RTSP server.

  • 0

In Delphi XE2, I’m using the TTCPClient component to communicate with an RTSP server. After trial and error not getting a response back from the server, I switched the project to send HTTP requests via port 80 (instead of 554 for RTSP) and tried to send a request to a website (www.google.com specifically). I’m still not getting any response.

I have a TTCPClient component on the main form (Form1) called Client, a TMemo control called Log, a TEdit control called txtHost, and a TBitBtn control. Here’s the relevant parts of the code:

Connecting to Server

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  if Client.Active then Client.Disconnect;
  Client.RemoteHost:= txtHost.Text;
  Client.RemotePort:= '80'; // '554';
  Client.Connect;
end;

OnConnect Event Handler (HTTP)

procedure TForm1.ClientConnect(Sender: TObject);
var
  S: String;
begin
  Client.Sendln('GET / HTTP/1.0');
  Client.SendLn('');
end;

OnConnect Event Handler (RTSP)

procedure TForm1.ClientConnect(Sender: TObject);
var
  S: String;
begin
  Client.SendLn('OPTIONS * RTSP/1.0');
  Client.SendLn('CSeq:0');
  Client.SendLn('');
end;

OnReceive Event Handler

procedure TForm1.ClientReceive(Sender: TObject; Buf: PAnsiChar;
  var DataLen: Integer);
var
  S, R: String;
begin
  S:= Client.Receiveln;
  while S <> '' do begin
    R:= R+ S;
    S:= Client.Receiveln;
  end;
  Log.Lines.Append('> RECEIVED ' + R);
end;

OnError Event Handler

procedure TForm1.ClientError(Sender: TObject; SocketError: Integer);
begin
  Log.Lines.Append('> ERROR '+IntToStr(SocketError));
end;

The OnReceive event is never called, nothing is coming back from any Server I’m connecting to.

What am I doing wrong here?

References

These are some links which I’m referencing to:

  • http://effbot.org/zone/socket-intro.htm
  • http://www.ietf.org/rfc/rfc2326.txt
  • http://folk.uio.no/meccano/reflector/smallclient.html
  • http://www.samsungdforum.com/upload_files/files/guide/data/html/html_3/reference/rtsp_specification.html

The camera I’m working with is Grandstream GXV3601LL

UPDATE

I’ve concluded that the issue is with the RTSP server, and have asked a question on the forums on Grandstream’s website. The code does work with other server connections.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:50:38+00:00Added an answer on June 13, 2026 at 12:50 am

    This works for me, it depends if you are in blocking mode or not:

    unit Unit11;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, Sockets, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, StdCtrls;
    
    type
      TForm1 = class(TForm)
        IdTCPClient1: TIdTCPClient;
        TcpClient1: TTcpClient;
        Memo1: TMemo;
        procedure TcpClient1Connect(Sender: TObject);
        procedure TcpClient1Receive(Sender: TObject; Buf: PAnsiChar; var DataLen: Integer);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
     TcpClient1.BlockMode := bmBlocking;
     TcpClient1.RemoteHost := 'www.google.com';
     TcpClient1.RemotePort := '80';
     TcpClient1.Connect;
    end;
    
    procedure TForm1.TcpClient1Connect(Sender: TObject);
    
    var s : string;
    
    begin
     memo1.Lines.Add('connected');
     TcpClient1.Sendln('GET /');
     s := TcpClient1.Receiveln;
     memo1.Lines.Add(S);
    end;
    
    end.
    

    EDIT

    here is a real world example with a RTSP server (youtube in this case)
    I used Indy IdTcpClient

    unit Unit11;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, Sockets, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, StdCtrls;
    
    type
      TForm1 = class(TForm)
        Memo1: TMemo;
        Client: TIdTCPClient;
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.FormCreate(Sender: TObject);
    
    var s : string;
    
    begin
     Client.Host := 'v5.cache6.c.youtube.com';
     Client.Port := 554;
     Client.Connect;
     Client.IOHandler.Writeln('OPTIONS * RTSP/1.0');
     Client.IOHandler.Writeln('CSeq: 1');
     Client.IOHandler.Writeln('');
    
     s := Client.IOHandler.ReadLn;
     Memo1.Lines.Add(s);
     s := Client.IOHandler.ReadLn;
     Memo1.Lines.Add(s);
    end;
    
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Delphi XE2 to communicate with a fairly large SOAP service. I've
Delphi-XE2 does not seem to have a TExcelWorksheet component. How do I get the
I'm using the TIdSSLIOHandlerSocketOpenSSL Indy component in Delphi XE2 to send data to an
I'm using Delphi-XE2 Enterprise, SQLServer 2008 R2 on Windows Server 2008 R2. When a
I'm using Delphi XE2 Update 3. Update 4 is not compatible with some of
Delphi XE2, so I guess that is Indy 10(?). One server, 10 clients. I
Using Delphi XE2 on Win 7 64 bit creating a 32 bit app... In
I am using Delphi XE2 and attempting to upgrade our usb comms dll to
I'm currently using delphi xe2. well the firemonkey part of it. I use to
I'm using Delphi XE2 with FireMonkey. I have read many other questions about MD5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.