muc协议调试

阅读更多

以下是我在调试xep-0045协议时使用的Class

协议地址:http://wiki.jabbercn.org/index.php?title=XEP-0045&variant=zh-cn#.E6.9C.AF.E8.AF.AD

 

public static void main(String[] args) throws XMPPException, InterruptedException {
		Connection conn = new XMPPConnection("192.168.1.102");
		conn.connect();
				
		conn.login("uubox", "123");
		conn.addPacketListener(new PacketListener() {
			@Override
			public void processPacket(Packet arg0) {
				System.out.println(arg0.toXML().replaceAll(">", ">\r\n"));
			}
		}, new PacketFilter() {
			@Override
			public boolean accept(Packet arg0) {
				return true;
			}
		});
		conn.sendPacket(new Packet() {
			@Override
			public String toXML() {
				return "  " +
						"  ";
			}
		});
		Thread.sleep(1000);
	}

 呵呵

你可能感兴趣的:(muc协议调试)