android socket code
<p>Why cant a socket be open with this code </p>

<pre><code>                try {
                    Connect=(Button)findViewById(R.id.connect);
                    InetSocketAddress address = new InetSocketAddress("192.168.1.2",54628);
                    DatagramPacket request = new DatagramPacket(cmd.getBytes(), cmd.length(), address);
                    DatagramSocket socket = new DatagramSocket();
                    socket.send(request);
                } catch (SocketException e) {
                    System.out.print("SSSS");
                }
</code></pre>

<p>but it work when i do 
    enter code here</p>

<pre><code>    clientSocket= new Socket("192.168.1.2",54635); 
    Text.append( "\n created a socket");
enter code here
05-24 23:04:58.497: ERROR/AudioPolicyManagerBase(95): unknown stream type
05-24 23:05:10.787: ERROR/AudioPolicyManagerBase(95): unknown stream type
05-24 23:05:10.787: ERROR/AudioPolicyManagerBase(95): unknown stream type
05-24 23:05:10.787: ERROR/AudioPolicyManagerBase(95): unknown stream type
05-24 23:05:10.787: ERROR/AudioPolicyManagerBase(95): unknown stream type
</code></pre>
