title: How to Connect to rild Socket
body: <p>I'm trying to write an app to talk to the rild.  And Yes, I know this is not politically correct, but it's an embedded industrial telemetry app so I'm not concerned about user experience, portability and all that stuff.</p>
  
  <p>The problem is that when I try to connect, I get a java.io "Permission denied" exception. Can anybody help me?</p>
  
  <p>The phone (Nexus One) is rooted with Cyanogenmod 7 and the app is running as superuser using the "SuperUser" app from Market.</p>
  
  <p>My Code (abbreviated):</p>
  
  <pre><code>try {
    mSocket = new LocalSocket();
    mSockAddr = new LocalSocketAddress( "rild", LocalSocketAddress.Namespace.RESERVED );
    mSocket.connect( mSockAddr );
  }
  catch( Exception e ) {
    dbg.p( "connect failed: "+e );
  }
  </code></pre>
  
  <p>I see the rild (and rild-debug) sockets in /dev/socket.</p>
  
  <pre><code>srw-rw----    1 root     radio            0 Feb 13 19:14 rild
  srw-rw----    1 radio    system           0 Feb 13 19:14 rild-debug
  </code></pre>
  
  <p>Could it be that the Dialer app is already connected and hogging the socket?</p>
  
  <p>BTW I initially tried to use the frameworks but got a humongus boatload of errors mostly about java and and third party classes unknown, so I gave up after days of hair-pulling. I've also STFW and this site - lot's of dancing around the issue but no concrete advice.</p>
  
  <p>Any help greatly appreciated.
  -John</p>