coronapankaj / asmack

Automatically exported from code.google.com/p/asmack
Other
0 stars 0 forks source link

can't connect to server ec2 of amazon with android 3.x or 4.x #74

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What are you doing to produce the error?
1. I use asmack for connect android to ec2 server of amazon. My config like 
that: 
try {
    SmackConfiguration.setPacketReplyTimeout(XmppServerConfig.TIME_OUT);
    SmackConfiguration.setPacketReplyTimeout(10 * 1000);

    ConnectionConfiguration config = new ConnectionConfiguration(
            XmppServerConfig.XMPP_SERVER_IP,
            XmppServerConfig.XMPP_SERVER_PORT           
    );

       config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
    config.setSocketFactory(new DummySSLSocketFactory());

    connection = new XMPPConnection(config);
    connection.connect();           
} catch(Exception ex){
    Log.e("TAG", ex.toString());
}

2. With android 2.2, i can connect well with this server. But i can't connect 
this server with android 3.x and 4.x. There is error like this: 
android.os.NetworkOnMainThreadException

I use version asmack-2010.05.07.jar

Thanks for help.

Original issue reported on code.google.com by luoiho...@gmail.com on 6 Aug 2012 at 4:14