开发者

send large text using asmack

开发者 https://www.devze.com 2023-02-05 14:21 出处:网络
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 immediatel

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

精彩评论

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