Hi, I’m spanish, and I have questions about Threads in openfire.
When I make a java des connection with a smack xmpp server Seller, I have a question and do not fall.
How do I make a thread that never ends? while (true) in the run?
What I’m trying to do is “leave a user always on” until the disconnect unwilling
I’ve seen chats say an advanced level using listeners, and have a simple run but that the user is always connected.
As I am confused on the topic threads ha threads that are used in messages (to synchronize messages obviously), the exchange of packets, that is where there is a run and an async task!
I hope you understand the problem presented before me.
If the user does not need any thread, and only messages telling me.
You really should be more clear about your problem.
What is a “des connection”?
You talk about a “Smack XMPP server seller”, which doesn’t make any sense to me.
You mix together Java Threads (concurrency) and Message Threads (XMPP), which are completely different things.
If your problem is, that Java Threads (and therefore your main()) are dying, maybe this is helpful, but it has nothing to do with XMPP, only with Java basics:
public static void main(final String[] args) {
// Create the main application thread, that will run forever and will keep the program alive.
Executors.newFixedThreadPool(1, new ThreadFactory() {