Java Code to send Jabber Instance Message
ConnectionConfiguration config = new ConnectionConfiguration("localhost",5222);
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
connection.login("demo", "password");
for(int i=0 ; i < 10; i ++)
{
Message message = new Message();
message.setTo("admin@localhost");
message.setBody("Test message from demo " + i);
message.setType(Message.Type.chat);
connection.sendPacket(message);
}
JABBER Installation
Download location
http://www.ejabberd.im/ejabberd-2.0.1
Or
http://www.process-one.net/en/ejabberd/downloads
Step1:
Download Linux x86 32-bits Installer from the download page
Step2:
ejabberd-2.0.1_2-linux-x86-installer.bin.gz
untar the gunzip using following command
tar –d ejabberd-2.0.1_2-linux-x86-installer.bin.gz
You will get
ejabberd-2.0.1_2-linux-x86-installer.bin
execute the bin file using following command (chmod 777 ejabberd-2.0.1_2-linux-x86-installer.bin)
./ejabberd-2.0.1_2-linux-x86-installer.bin
You will get following screens
Improving the speed
%% For all users except admins used "normal" shaper
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
Change "normal" to "fast":
%% For all users except admins used "fast" shaper
{access, c2s_shaper, [{none, admin},
{fast, all}]}.
Wednesday, August 6, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment