XMPP offline message(s) received every time user logs in - xmpp

I am working with XMPP server, backend enabled with BuddyCloud. Everything is working fine.
My only issue is, when someone sends me an offline message (means when I am offline), so when I logs in again and send my Presence all the offline message start receiving.
Scenario:
If I am offline, and someone sends me the message, I should not receive it and it happens correctly. And when I came online, I should receive that message. Which I receives and it is correct till this point.
Now when I come online any next time, I always receive that message, which I have received already. Tell me If I am still not clear with my issue.
Can anyone help me?

Related

swift HTTP Requests

I have created an instant messenger chat application where by messages are posted to my server via a php service and stored in a mysql backed.
If a user has their 'inbox' page open and a new message is received I would need to update the table to show any new messages. The way I am doing this at the moment is by sending an http request to the server every 5 seconds.
As you can imagine this is pretty inefficient. What methods are available which would be more suitable and less resource heavy?
I have looked at keep alive connections and web sockets but Im not sure which direction I should be going in?
any help much appreciated!
Your approach is called polling, which is not efficient because it consumes more electricity from your phone and you have extra load to your server. The correct way of doing it is though Apple's push notification. Here is the tutorial for that. Basically your server will send request to Apple's push notification center when a new message is received.
However in your case it's a bit more complicated. You want this notification only after user entering the mail page. So you need to tweak your php server to send notification only after user entered the mail page. In this case you are sending only one request to your server telling it to start sending notifications, instead of constantly polling your server

Cold Fusion Mail Being Repeatedly Sent By CF 10 Server

I'm migrating an app from a CF8 Server to a new CF 10 Server. As I was working with a form that sends an email everything seemed to work as it should and I received a copy of the email. And then another, and another. Every 15 seconds the server would send me the same email.
I took the mail server out of the CF Admin and still the duplicates kept coming. I checked the spool and undeliverable folders and they were both empty. The only thing that stops the emails from being sent is to stop the actual ColdFusion Application Service. When I restarted the service, however, the emails started up again!
I created a simple test page that has only a minimal CFMAIL tag with the basic fields and gave that a try. Same thing. Only now I have two emails coming into my inbox every 15 seconds while the service is running.
The mail log shows the emails being sent but doesn't give any indication of how they are being triggered. I can't understand where these emails might be stuck in the CF Server in a way that they are sent every 15 seconds. I've Googled it mightily with no leads.
Has anyone else experience anything like this? Thanks for any guidance.

What are the problems in 3-way Message passing Reliable IPC protocol?

Here, at the end of this page. last paragraph ,
They mentioned some problems that occurs in This protocol.
i am unable to understand what are these problems. ?
for example. He told. "If a request processing long time"
I am unable to understand this statement. Where is the request which processing taking long time, on client ? or on server ?
Or i am unable to understand where is the Clock(time) ? is it on Client side or Server Side? because here mentioned in the end of 2 point. "if the reply is not received within the time period , the kernel of the client machine re-transmits the request message."
Consider this:
The client sends a message. If it doesn't get a reply from the server within - say - 1 minute it will transmit the message again.
When the server receives a message, it only sends a reply after having generated a full response to the message that the client sent.
No suppose you, as client, send a message to the server. The server receives your message, and starts processing it. At this time, you, the client, have no idea of whether the server got the message or not. Assume you send a complicated task to the server, which takes it 1 minute and 5 seconds to complete. After 1 minute (ignoring transmission times), the server is still busy doing your work, but you as the client don't know of any of this and send your message again.
Now, depending on the actual protocol implementation, there are a few potential issues:
It's possible that by sending the message again, you increase some sequence count and are therefore unable to receive the reply to the original message afterwards.
It's possible that the server isn't able to determine whether a message that arrives is the first message or a message that had to be send again. So it could be doing work that it already did, leading either to needless processing or in the worst case to (business) logic errors.
Additionally, by sending both the message and the reply possibly needless more than once, you increase the amount of total data transmitted, without gaining anything from it.
To "solve" this, you could increase the waiting time before the client sends its message again. This will "fix" the issue with long running tasks on the server, but will also hurt in case the message actually got lost on the way, because you're waiting longer to even send a new message.
The "real" solution here is to have the server acknowledge as soon as it receives a message from the client, just as saying "i got your message, i'll send the reply soon!" before even starting to actually process the message.

Tigase and xmpp, 1st offline message not getting received

hi I am using Tigase and xmpp for chat application, everything is working fine except i am not receiving first offline message.
Eg: there are 2 users A and B, A send 3 messages to B but B is offline(i.e. app is in Not running state), but when B comes online he receive only 2 messages(last 2), first message always get missed.
Help me to solve this issue.
I faced the similar problem, on client side we can't do anything for that as XMPP(Tigase) server automatically returns all the offline messages when user comes online. There might be some problem in Tigase server which is not returning the first message. Because all the offline messages you will receive in
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message
and it can be checked first offline message is not returned by server.

Possible reasons for QSSLSocket to stop sending/receiving data

Can anybody give me a possible reason why my QSSLSocket would stop sending and receiving data without firing a stateChanged or disconnected signal.
My app starts a thread which connects to Facebooks XMPP server, authenticates and then goes into a while loop calling waitForReadyReady(10000) and then if this returns true it will read the data. Sometimes, After a while this call to waitForReadyReady will never return true even though there should be something to read and if I try to send data at this point the server won't receive anything.
I am sending pings to the XMPP server and can detect when this has happened after not receiving a reply to my ping but it's not really usable as an app until I get to the bottom of why communication is sometimes just breaking down between client and server.
Can anybody offer any insights please?