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

  • SEARCH
  • Home
  • 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 8335489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:41:33+00:00 2026-06-09T03:41:33+00:00

I can connect to my Rtsp server using pre made software, but with the

  • 0

I can connect to my Rtsp server using pre made software, but with the following piece of code I am unable to get an answer from the server. Even though the connection is successfull, the server does not answer me.

public class RtspClient {

private Socket server;
private InputStream is = null;
private OutputStream os = null;
private int seqid = 1;
private String request, resp;
private byte[] buffer = new byte[4096];
private int len = 0;


public RtspClient(String rIp, int rPort) {

    try {
        //INIT
        server = new Socket(rIp, rPort);
        is = server.getInputStream();
        os = server.getOutputStream();
        System.out.println("Connected to "+ rIp + ":" + rPort);

        //COMMUNICATION
        Boolean isTalking = true;
        while(isTalking == true) {

            //sending request
            String request = new String("OPTIONS * RTSP/1.0\r\nCSeq: 0\r\n");
            os.write(request.getBytes(), 0, request.length());
            System.out.println("Sent: "+ request);
            /////////////////

            //getting response
            len = is.read(buffer, 0, buffer.length);

            if(len > 0) {
                resp= new String(buffer, 0, len);
            }
            else {
                resp = "empty";
            }

            System.out.println("Received: "+ resp);
            //////////////////
        }
    } catch (UnknownHostException e ) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

}

Here’s a screenshot of wireshark : http://imageplay.net/img/tya22277766/Untitled.png

The answer from the server should be:

RTSP/1.0 200 OK
Supported: play.basic, con.persistent
Cseq: 0
Server: Wowza Media Server x.x.x.x buildxxx
Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS, ANNOUNCE, RECORD, GET_PARAMETER
Cache-Control: no-cache

Thanks!

  • 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-09T03:41:36+00:00Added an answer on June 9, 2026 at 3:41 am

    Alright, to make it short, the request should be :

    OPTIONS * RTSP/1.0\r\nCSeq: 0\r\n\r\n
    

    instead of

    OPTIONS * RTSP/1.0\r\nCSeq: 0\r\n\
    

    Simply add a new line at the end and the server will answer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to connect with WPA2 in android (I can connect
With the following code I can connect to mysql: mysql_connect(localhost,username,); But if I change
I can connect to server and get json data. it is in this format:
To test if i can connect to my database, I execute the following code
Is there a way that I can connect to a TCP server using a
Is there any free code generating tool that can connect to crm server and
I can connect to my sql server 2008 developer server using this in a
The Java client can connect to the C++ server using TCP. The Java client
I'm writing a piece of open-source client software that can connect to web services
I have SQL Server 2008 to which I can connect using domain user credentials.

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.