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 6680305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:27:34+00:00 2026-05-26T04:27:34+00:00

I am building a chat based on Comet technology and I am stuck with

  • 0

I am building a chat based on Comet technology and I am stuck with this problem. So, for comet, i am using ningx with it’s push module. Everything works fine. I can send messages to another user via dedicated channels. However, the problem appeared when I started thinking what will happen to the message which was sent to a user who went offline before receiving that message.
I’d like before pushing the message into a channel to check if the receiver is still listening that channel. If so, I will just push the message otherwise I want just put the message into the database so that the user could read it when he/she is online.

QUESTION:

  1. Can I check somehow if a specific channel currently has at least one subscriber (for nginx push module)? if it’s impossible then how to know for sure that the user to who the message is sent is online? (last activity is not going to help, cuz it’s impossible to be sure that the user did not go offline one second before he/she was supposed to receive the message)

Thanks!

  • 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-05-26T04:27:35+00:00Added an answer on May 26, 2026 at 4:27 am

    I’ve answered on my own question. Here’s the code I use to publish a message and how I get an useful information back after publishing it.

    $channel_id = 'c'.$_POST['uid'];
    
    $message['sender']=$_SESSION['user.ID'];
    $message['firstname']=$_SESSION['user.firstname'];
    $message['message']=$_POST['msg'];
    $message['type']='chat';
    
    $c = curl_init('http://192.168.56.101/publish?cid='.$channel_id);
    curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($c, CURLOPT_POST, true);
    curl_setopt($c, CURLOPT_POSTFIELDS, 'pre('.json_encode($message).')');
    $r = curl_exec($c);
    

    in this example var $r contains this: queued messages: 0 last requested: 4 sec. ago (-1=never) active subscribers: 1

    as u can see, it also contains a number of subscribers

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

Sidebar

Related Questions

I'm building a video chat in flash and everything works really well, except for
Well, lets say I'm building ActiveMQ based chat application. It's pretty simple. Having only
I'm building a live chat using JSJaC and ejabberd . It's all working except
i building an chat app and i have a little problem, build cellforrowatindexpath: -
i am building a chat room using php/mysql and jquery. I need to make
Building a website. When I order my tags like this, LightCycle works but Lightbox
I am building a chat application using JSP, Servlets and Ajax with Smack API.
I'm building a simple real time chat using Juggernaut, Redis, SQLite and Rails 3.1
I'm building a web-based chat app which will need to make an AJAX request
I'm building a chat application using OpenFire server and JSJaC client library. The page

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.