In the current version, ports below 1024 aren't accessible to applications.

JBQ

On Thu, Dec 18, 2008 at 7:47 PM, Moto <[email protected]> wrote:
>
> I have been trying to create a local RTSP server on my phone but I
> haven't had any luck! I'm trying to connect from MediaPlayer to my
> localhost server on port 8554 since port 554 doesn't work at all....
>
> My server handles the replies to the mediaplayer but somehow the
> player shuts down right away as if no messages were getting to it from
> my server.  I hope you can understan what I'm trying to achieve here.
> I'm not sure if there are some firewalls? I'm using a G1 phone to test
> this.
>
> Thanks!
> Moto
>
> Here is my code:
> Thread 1:
> //1. creating a server socket
> providerSocket = new ServerSocket(8554, 10);
> //2. Wait for connection
> connection = providerSocket.accept();
> providerSocket.close();
> ClientIPAddr = connection.getInetAddress();
> //3. Set input and output stream filters:
> RTSPBufferedReader = new BufferedReader(new InputStreamReader
> (connection.getInputStream()) );
> RTSPBufferedWriter = new BufferedWriter(new OutputStreamWriter
> (connection.getOutputStream()) );
>
> //4. The two parts communicate via the input and output streams
> System.out.println("C->S");
> do{
>        message = RTSPBufferedReader.readLine();
>        System.out.println(message);
> }while(message.length()!=0);
>
> System.out.println("S->C");
> send_RTSP_OPTIONS_response();
>
> System.out.println("C->S");
> do{
>        message = RTSPBufferedReader.readLine();
>        System.out.println(message);
> }while(message.length()!=0);
>
> System.out.println("S->C");
> send_RTSP_DESCRIPTION_response();
>
>
> Thread 2:
>
> m = new MediaPlayer();
> m.setDataSource("rtsp://localhost:8554/mobile/SR-P3Rockster.sdp");
> m.prepare();
> m.start();
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to