-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJabberChat.java
More file actions
33 lines (21 loc) · 916 Bytes
/
Copy pathJabberChat.java
File metadata and controls
33 lines (21 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class JabberChat {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
String username = "[email protected]";
String password = "lakshimi";
JabberConnection jabberConnection = new JabberConnection("jabber.hot-chilli.net", 5222);
jabberConnection.init();
jabberConnection.performLogin(username, password);
System.out.println("reached");
jabberConnection.setStatus(true, "Hello everyone");
String buddyJID = "[email protected]";
String buddyName = "testuser2";
jabberConnection.createEntry(buddyJID, buddyName);
jabberConnection.sendMessage("Hello mate", buddyJID);
boolean isRunning = true;
while (isRunning) {
Thread.sleep(50);
}
jabberConnection.destroy();
}
}