Hi there!
I’'m having a problem with sending messages to a telnet client.
I have two users login the jabber server. One is using a telnet and the other one is my java application.
My java application is trying to send a message to the other client but the telnet client does not receive the message.
The code below has a sort of a link list containing the XMPPConnection objects.
res.get2() //Returns a XMPPConnection
My code snippets:
import java.io.*;
import java.util.*;
import java.sql.*;
import java.util.Date;
import org.jivesoftware.smack.*;
import java.text.SimpleDateFormat;
public class Handler
public synchronized boolean sendMethod(String phone, String destEmail, String message, String servicecode)
{
try{
String hostName = res.get2().getHost();
String userName = res.get2().getUsername();
System.out.println("\nHost name : " + hostName + "\nUsername : " + userName + "\ndestEmail : " + destEmail + "\nIsConnected : " + res.get2().isConnected());
res.get2().createChat(destEmail).sendMessage(message);
} // try
catch(XMPPException e){
}
return (sendMethodStatus);
}
}
My problem here is that res.get2() returns the right XMPPConnection object. It sends the message to the server but my telnet client could not get the message.
Am I doing it wrong?
Thanks very much