Hi everyone,
I’m doing an IM system with smack and openfire which need a function to implement filetransfer.
I have initialize a conneciton for send and receive message, and the port is 5222.
ConnectionConfiguration config=new ConnectionConfiguration(ConstantUtils.IPAddress,5222);
config.setSASLAuthenticationEnabled(false);
config.setSecurityMode(SecurityMode.disabled);
ConstantUtils.conn2=new XMPPConnection(config);
try{
ConstantUtils.conn2.connect();
ConstantUtils.conn2.login(ConstantUtils.loginname, loginpasswd);
System.out.println("connect succes");
}catch(XMPPException e){
e.printStackTrace();
}
The code works fine.
But when I want to initialize the connection for filetransfer. It doesn’t work.
The code is almost the same except the port, I have change it to 7777.
ConnectionConfiguration config= new ConnectionConfiguration(ConstantUtils.IPAddress,7777);
config.setSASLAuthenticationEnabled(false);
config.setSecurityMode(SecurityMode.disabled);
ConstantUtils.fileconn=new XMPPConnection(config);
try {
ConstantUtils.fileconn.connect();
System.out.println("connect done");
ConstantUtils.fileconn.login(ConstantUtils.loginname, loginpasswd);
System.out.println("login done");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
It doesn’t work or catch any excepiton.
Did I do it a wrong way?
Thank you.
Strong Su