Почему сокет не может быть открыт с этим кодом:
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");
}
но это работает, когда я делаю:
clientSocket= new Socket("192.168.1.2",54635);
Text.append( "\n created a socket");
Журналы ошибок:
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