开发者

send large text using asmack

I 开发者_如何转开发use asmack building a jabber client for android, it works well ,but I got a problem when sending a large text in Chinese. The XMPPConnection just disconnected from server immediately,here are my Codes of Connection initialization:

   ConnectionConfiguration c = new ConnectionConfiguration(mServerAddress, mPort); 
   c.setSecurityMode(SecurityMode.disabled);
   c.setReconnectionAllowed(true);
   c.setCompressionEnabled(false);   
   mConn = new XMPPConnection(c);

and I send a chat message like this:

   final Message msg = new Message(chatMsg.getTo(), Message.Type.chat);
   msg.setBody(chatMsg.getBody());

   new Thread() {
 @Override
 public void run() {
  if(mConn != null && mConn.getUser() != null) {
   mConn.sendPacket(msg);
  }
 }
   }.start();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜