Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 52
Registered: ‎11-03-2008
My Device: Not Specified

RTSP and Socket Connection

Hi all,

 

Hope you are doing great !

 

I am developing an application which opens a socket connection to a Darwin RTSP Server. I am able to successfully make the connection and write data to it (which I confirm by seeing the Server Log). But whenever I try to read the server's response, I get an "Connection Time Out" exception; Everytime !

 

Can anyone please help me on this ? Below is the code I am using:

 

-------------------------------------------------------------------------------------------------------------------------------------

CODE...

-------------------------------------------------------------------------------------------------------------------------------------

//  Socket Connection To Streaming Server
            SocketConnection sc = (SocketConnection)
                         Connector.open(strServerURL, Connector.READ_WRITE);
            sc.setSocketOption(SocketConnection.KEEPALIVE, 5);                        
        
            OutputStreamWriter _out = new OutputStreamWriter(sc.openOutputStream());
            strSendData_ = "DESCRIBE rtsp://192.168.60.77:554/123.mp4 rtsp/1.0\n";
            strSendData_ += "CSeq: 1\n";
            //strSendData_ += "Accept: application/sdp";
            int length = strSendData_.length();
            _out.write(strSendData_, 0, length);
           

            InputStreamReader _in = new InputStreamReader(sc.openInputStream());
            char[] input = new char[length];
            for ( int i = 0; i < length; ++i ) {
            input[i] = (char)_in.read();                              // Line at which I get the exception
            };                       
           
            strReceiveData_ = String.valueOf(input);

-------------------------------------------------------------------------------------------------------------------------------------

... END : CODE

-------------------------------------------------------------------------------------------------------------------------------------

 

Thanks

- arun

New Contributor
Posts: 2
Registered: ‎06-25-2012
My Device: 9800

Re: RTSP and Socket Connection

Can anyone tell me the solution for follwing Exception

Protocol not found: net.rim.device.cldc.io.rtsp.Protocol