-
Notifications
You must be signed in to change notification settings - Fork 38
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
no auth request received - if delay in socket connection #8
Comments
Hi @padmanabanravikumar , I am on the fence as to whether we ought to remove the response timeout code altogether (you will see that it is marked with the [Obsolete] attribute in the codebase.) However, if you are using database logging with NLog, then perhaps you might benefit from wrapping your database logging in an async target: https://github.com/nlog/NLog/wiki/AsyncWrapper-target Since working with FreeSwitch can involve a lot of trial and error, NEventSocket can be quite chatty with its logs to give you as much information as possible, you might also want to filter out Trace and Debug level logs from going to the DB. |
thank you for your support. its working fine now. |
Is this an Inbound socket controlling many channels or with just one channel? |
Have you tried calling socket.SubscribeEvents() after connecting? |
i am just using one channel. |
Let's move this discussion to the chat room: https://gitter.im/danbarua/NEventSocket |
I've managed to replicate this now. Using LINQ queries with Rx is nice but sometimes you get race conditions where the message you want has arrived before the subscriber has been hooked up. |
Is there any workaround? |
Try the latest code, it should be ok now - v0.3.0 is up on NuGet. |
@padmanabanravikumar Did this work for you? |
yes, thank you. |
"No Auth Request received within the specified timeout of 00:00:05" exception thrown when using NLog with database logging. If i remove NLog then everything works fine.
var socket = new InboundSocket(host, port, timeout);
await
socket.Messages.Where(x => x.ContentType == ContentTypes.AuthRequest)
.Take(1)
.Timeout(
socket.ResponseTimeOut,
Observable.Throw(
new TimeoutException(
"No Auth Request received within the specified timeout of {0}.".Fmt(socket.ResponseTimeOut))))
.Do(_ => Log.Trace(() => "Received Auth Request"), ex => Log.ErrorException("Error waiting for AuthRequest.", ex))
.ToTask();
In these statements, If there is no delay in execution between these two statements it just works fine. and if there is a delay executing the second statement then it always fails.
for example, if we add the "System.Threading.Thread.Sleep(50);" in between the above two statements then second statement always fails and throws "No Auth Request received within the specified timeout of 00:00:05" exception.
The text was updated successfully, but these errors were encountered: