Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8653583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:34:45+00:00 2026-06-12T14:34:45+00:00

I want execute some code after a message has already sent in jaxl. which

  • 0

I want execute some code after a message has already sent in jaxl.
which callback is appropriate for this situation?

    public function test() {

        require_once 'JAXL/jaxl.php';
        global $client;

        $client = new JAXL(array(
            'jid' => 'user@localhost',
            'pass' => 'password',
            'log_level' => JAXL_INFO
        ));

        $client->add_cb('on_stream_features', function($stanza)  {
            global $client,$thisObj;
            $client->send_chat_msg('otherUser@localhost','Message');  
        });

       $client->add_cb('on_message_send',function(){  //some thing like this
         //some code
       });
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:34:46+00:00Added an answer on June 12, 2026 at 2:34 pm

    Jaxl library currently doesn’t support such callbacks. This is because when you call $client->send_chat_msg(), XMPPStream queues XMPPMsg object in the output buffer of underlying JAXLSocketClient. Output buffers are flushed as and when socket is ready for write.

    Before queuing all XMPPStanza‘s are serialised (to_string()) by XMPPStream, thus underlying JAXLSocketClient output buffers have no knowledge about which stanza is being flushed over the write ready socket. As a result no such callbacks are currently possible.

    There are non-authoritative ways of performing check about delivery status of your message e.g. is the output buffer empty? But this is tricky and not a perfect solution.

    Perfect way to implement such callbacks will be to maintain output buffers within the context of XMPPStream, which should then be notified about underlying socket write ready state, finally before flushing stanza’s over the socket, XMPPStream can execute these callbacks. Unfortunately, this is not how the library is designed. Though, possibilities are that such callbacks might get supported in future version of the library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to execute a code helloword.cpp which takes in some argument from console
I want to execute some code right before the layout is rendered, after all
I need to execute some code after the subclass already did all it's initialization,
I want to execute some Python code, typed at runtime, so I get the
I need execute some code before Windows shutdown process each time. So, I want
I want to execute some code in a Django model when it is first
I want to execute the code in the try block again after an exception
My question is... If we try to execute some code after startActivity() will it
I want to run some code after the eclipse goal of the eclipse plugin
I want to execute some javascript which is part of html I download through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.