-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop subscribe mailbox with unknown error #174
Comments
are you catching error on |
No, i am not. I should catch error and call Open again,right? |
first check what is the error it give, log it in console or in file to review later. if there is something I can fix that would help others |
Hi, i have similar problem. When internet connection lost, i catch disconnect event. And i try reopen connection but i can not catch any error.
Is this code true? |
@soptimizer you can not do it this way, if you are consuming |
@gautamsi thanks for fast response.
In this code, conn.Open() is working. But after the ".then" function is not working. |
this is what i do and works for me. |
@duongkha did you receive any error in the error block? |
Yes. the error is "'You must add at least one subscription to this connection before it can be opened.'" I guess that it happened inside your code that the subscription somehow is disappeared. |
I tried q promise and it works. Success function was called. But when i lost the internet connection, error function was not called. So i can not handle net connection error. Do you have a suggestion for me? |
I will take a look on this sometime this week. |
what i am trying to do is dispose the current connection and create new connection with subscription, it seems to be working now. but let's see if it is stopped working for long run or not. |
@duongkha How do you catch "disconnection"? In my code when i disconnect the connection, "OnDisconnect" is working correctly. In this situation, I call conn.Open() but I can not receive any error. |
i also subscribe Disconnected event and reconnect again only. |
@gautamsi : I tried to set the timeout to 1 minutes of subscribing the mailbox. however, i recognized that sometimes, it called to reopen the connection and it failed, nothing response with Open() call. What should we do when the Open is failed? Should we recall Open again? |
@duongkha I'm struggling with the same problem. How can i catch when the Open function is failed? Not : Why are conn.IsOpen and conn.isDisposed always false? @gautamsi
|
try the gist for subscription example. It worked for me when there was no internet. |
@gautamsi I tried code that you suggested. It is working for when connection cut off. But Promise not work for Open() function. I can not understand Open() process successed or failed. If i solve this problem i can handle all condition that i need. Do you have a suggestion for me? |
I see the problem. the issue is Will have to take deeper look on this. |
@gautamsi Yea. I see this problem too. I can't handle when the internet is interrupted. The Open() function does not return success or fail. Do you have idea to check if the connection state is failed? I need to repeatedly reconnect in my code. |
you can now use |
Hi, gautam. I tested this with 0.9.0-dev.5. I encountered a strange error. When i call open function first with then(successFunc,errFunc) the code do not enter to success or error func. When connection timeout, previous success message shown. Sample code and output at below.
Precalling. 1 |
I see the way current code is organized, It resolves only after HTTP connection stream is disconnected. I can resolve the promise early in header event (when first headers arrive) but that may be bit early. other place I can resolve promise is when first data section arrives, but that may be late, data event is fired when first set of notification is received. |
I have finally decided to wrap this in OnResponseHeader delegate (similar to OnDisconnect) so that you can also look for headers and test for connection (which is always true if you received header). |
@gautamsi : My app is running 24/7, but if there is any error with the connection open sometimes, there is no returned error that helps me to know in order to call reconnect. My question is " Is it possible to check the connection state by a timer to know if the connection is still ok"? |
this is published in dev6 tonight. you can use timer to check |
please reopen if needed. |
@gautamsi, thanks for this awesome library! I'm also experincing the issue with
Output:
The bigger issue is that for some reason, we stop receiving email notifications. |
Furthermore,
|
I have to find time to replicate this. stay tuned. |
Hi,
I am trying to subscribe a mailbox to get new email coming and the application is running continuously to monitor the new email automatically. I use SubscribeToStreamingNotificationsOnAllFolders and StreamingSubscriptionConnection with timeout 30 minutes.
I also subscribe OnDisconnect event to reconnect by calling connection.Open();
and OnNotificationEvent to listen new email.
It was working very well for monitoring the new email in mailbox, however, it is stopped after running for a while (a day or some hours) without error alarm. I don't know when i will happen, just see it stops listen the new email. I have no idea if this is an issue of library or we need to do something extra to handle the case to re-connect to mailbox.
Could you please advise what i can do to fix the issue?
Thanks in advanced.
The text was updated successfully, but these errors were encountered: