国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
smack聊天室組的創(chuàng)建
public XMPPConnection loginByUserName(String userName, StringpassWord) {
  ConfigTools configTools = newConfigTools();
  ConnectionConfiguration config= new ConnectionConfiguration(configTools.getOpenfireIp());
  //serverIp表示的是你openfire服務(wù)器地址
  config.setReconnectionAllowed(false);
  config.setSendPresence(false);
  XMPPConnection connection = newXMPPConnection(config);
  try {
   connection.connect();
   connection.login(userName,passWord);
   System.out.println(connection.getUser()+ " 登錄即時(shí)通訊服務(wù)器成功!");
  } catch (Exception e) {
   System.out.println("登錄即時(shí)通訊服務(wù)器失??!");
  }
  return connection;
 }
 
 public void creatMultiRoom(String userName,String passWord){
  try {
   //使用XMPPConnection創(chuàng)建一個(gè)MultiUserChat 
   MultiUserChatmuc = new MultiUserChat(loginByUserName(userName, passWord),"
   //獲得聊天室的配置表單 
   Form form =muc.getConfigurationForm(); 
   //根據(jù)原始表單創(chuàng)建一個(gè)要提交的新表單。 
   FormsubmitForm = form.createAnswerForm(); 
   //向要提交的表單添加默認(rèn)答復(fù) 
   for (Iteratorfields = form.getFields(); fields.hasNext();){ 
      FormField field = (FormField)fields.next(); 
      if(!FormField.TYPE_HIDDEN.equals(field.getType()) 
   &&field.getVariable() != null) { 
          // 設(shè)置默認(rèn)值作為答復(fù) 
          submitForm.setDefaultAnswer(field.getVariable()); 
      
   
   //設(shè)置聊天室的新?lián)碛姓?nbsp;
   // Listowners = new ArrayList(); 
   //owners.add("liaonaibo2\\40slook.cc"); 
   //owners.add("liaonaibo1\\40slook.cc"); 
   //submitForm.setAnswer("muc#roomconfig_roomowners",owners); 
   //設(shè)置聊天室是持久聊天室,即將要被保存下來(lái) 
   submitForm.setAnswer("muc#roomconfig_persistentroom",true); 
   //房間僅對(duì)成員開(kāi)放 
   submitForm.setAnswer("muc#roomconfig_membersonly",false); 
   //允許占有者邀請(qǐng)其他人 
   submitForm.setAnswer("muc#roomconfig_allowinvites",true); 
   // 能夠發(fā)現(xiàn)占有者真實(shí)JID 的角色 
   //submitForm.setAnswer("muc#roomconfig_whois","anyone"); 
   //登錄房間對(duì)話 
   submitForm.setAnswer("muc#roomconfig_enablelogging",true); 
   //僅允許注冊(cè)的昵稱登錄 
   submitForm.setAnswer("x-muc#roomconfig_reservednick",true); 
   //允許使用者修改昵稱 
   submitForm.setAnswer("x-muc#roomconfig_canchangenick",false); 
   //允許用戶注冊(cè)房間 
   submitForm.setAnswer("x-muc#roomconfig_registration",false); 
   //發(fā)送已完成的表單(有默認(rèn)值)到服務(wù)器來(lái)配置聊天室 
   muc.sendConfigurationForm(submitForm); 
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
 
  
 public IQ joinXml(){ 
    IQ iq = newIQ() { 
      public String getChildElementXML() { 
      StringBuilder buf = new StringBuilder(); 
           buf.append(""); 
           buf.append(""); 
           buf.append("<").append("conference").append("name=\"ccc\"").append("autojoin=\"false\"").append(""); 
           buf.append(""); 
           buf.append(""); 
           return buf.toString(); 
       
   }; 
   iq.setType(IQ.Type.SET); 
   //方法如名,這里是設(shè)置這份報(bào)文來(lái)至那個(gè)JID,后邊的/smack是這段信息來(lái)至哪個(gè)端,如spark端就是/spark,android就是/Smack 
   iq.setFrom("

    returniq; 
 
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
java實(shí)現(xiàn)簡(jiǎn)單XMPP發(fā)送消息和文件的簡(jiǎn)單例子
基于xmpp openfire smack開(kāi)發(fā)之smack類庫(kù)介紹和使用[2]
Struts1.x配置 實(shí)現(xiàn)表單驗(yàn)證
could not connect to XMPP server via smack:no response from server
xmpp的初步認(rèn)識(shí)
An easy JDBC wrapper(Database.java)
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服