Closed GoogleCodeExporter closed 9 years ago
Which API are you using? Conversation or MessageManager?
Original comment by freezing...@gmail.com
on 31 Jan 2011 at 7:12
I am using MessageManager.
it reports RateLimiteExeeded error
Original comment by shoujies...@gmail.com
on 31 Jan 2011 at 7:17
Something I find interesting:
at first, the robot doesn't have any contact and then start to accept
invitation from other contacts.
eventually, there are 18 contacts on the list. when a contact is added, it is
also added into the message loop. The message is sent in every 10 seconds.
Everything here is fine.
after I restart the robot, it login and start to send message to its 18
contacts and the RateLimiteExeeded error thrown out. 8 or maybe 11 contacts
receive the message while others don't.
The frequency to send messge in 2 cases is the same.
Original comment by shoujies...@gmail.com
on 31 Jan 2011 at 8:59
can you attach the trace log output from MSNPSharp?
Original comment by freezing...@gmail.com
on 31 Jan 2011 at 9:53
Try to use MessageManager.EndConversation(ConversationId) to force a
conversation exit.
Original comment by freezing...@gmail.com
on 31 Jan 2011 at 10:04
Thanks again!
I use MessageManager.EndConversation to close a conversation. Here is the trace
log.
Original comment by shoujies...@gmail.com
on 31 Jan 2011 at 1:56
Attachments:
All message you sent is UUM offline message, before sending your message out,
please check whether the contact is online, or listen to
NSMessageHandler.ContactOnline event.
Original comment by freezing...@gmail.com
on 31 Jan 2011 at 8:48
thank you for reminding.
I tested it again. This time, the messages were sent to online contact.
Here are 2 logs:
trace-end-conversation.log -- I use MessageManager.EndConversation to close a
conversation
trace-not-end-conversation.log -- I don't explicitly close a conversation.
Original comment by shoujies...@gmail.com
on 1 Feb 2011 at 2:01
Attachments:
The problem is, you can't initial too many conversation in a short period. I
guess you just a for(..){ sendmessage(..); } style code, this is going to flood
Microsoft's server, so you get the error. Try to send message slower. BTW,
please add timestamps to the log.
Original comment by freezing...@gmail.com
on 4 Feb 2011 at 8:22
Yes, what i do is
for (contact in contact list)
{
ConversationID converId = messenger.MessageManager.GetID(c);
converId = messenger.MessageManager.SendTextMessage(converId, new TextMessage(msg));
messenger.MessageManager.EndConversation(converId);
}
I thought using EndConversation method can help me work around session
limitaion but it not.
I have added the timestamp to the log.
Original comment by shoujies...@gmail.com
on 4 Feb 2011 at 4:04
Attachments:
You need to know that all the calling are asynchronous, that means, when you
call messenger.MessageManager.SendTextMessage(converId, new TextMessage(msg));
The conversation is actually not yet established. What the library do is
putting your requests in the queue and waiting the conversation connected and
all the negotiation done. The conversation will established a few seconds after
you call MessageManager.SendTextMessage. However, you call EndConversation
BEFORE it actually done with the negotiation. So nothing will happen (since the
conversation is not yet created, nothing will be ended), you are still flooding
Microsoft's server.
Original comment by freezing...@gmail.com
on 4 Feb 2011 at 9:18
The whole logic works like this: When you call MessageManager.SendTextMessage,
you message was put into a queue, the method return immediately, and the
library began to request a conversation from Microsoft MSN server. The request
procedure will lasts for several seconds. Once a conversation was established,
the library will pop the message from the queue and send it out. You CANNOT
request too many conversation at a time (This is what you are doing now) or you
will get a server error.
Original comment by freezing...@gmail.com
on 4 Feb 2011 at 9:23
Original comment by freezing...@gmail.com
on 4 Feb 2011 at 9:23
Thanks for explaination. I think I will build a queue to hold the sessions.
Is there any way I can be notifed that a message has been sent? Otherwise, I
have to wait for 5 seconds(for example) since the conversation is initiated so
that I can invoke EndConversation() method successfully?
Original comment by shoujies...@gmail.com
on 5 Feb 2011 at 7:02
I am afraid that you need to use the old conversation API (The MessageManager
is just a wrapper for the conversation API, you can take a look at how I
implement it), which will leverage the conversation directly.
Original comment by freezing...@gmail.com
on 5 Feb 2011 at 7:16
BTW, if you have further question, please send me email:
freezingsoft@hotmail.com.
Original comment by freezing...@gmail.com
on 5 Feb 2011 at 7:17
Original issue reported on code.google.com by
shoujies...@gmail.com
on 31 Jan 2011 at 6:25