Smpp Dissconnect and re connect
-
- Posts: 85
- Joined: Thu Jun 20, 2019 9:34 am
Smpp Dissconnect and re connect
Hi, i get sometimes dissconnection, and i did a reconnect after 10- 20 seconds.
my project run's on a windows service, and i see that it tried to reconnect over and over and fail's.
only when i restart the service the connection is bind with no issues.
any recommandations ?
my project run's on a windows service, and i see that it tried to reconnect over and over and fail's.
only when i restart the service the connection is bind with no issues.
any recommandations ?
Re: Smpp Dissconnect and re connect
which error did you get?
-
- Posts: 85
- Joined: Thu Jun 20, 2019 9:34 am
Re: Smpp Dissconnect and re connect
i see in the log that it got dissconnected and from that point every recoonection fails,
i will see what i can add to the log to catch this next time
i will see what i can add to the log to catch this next time
-
- Posts: 85
- Joined: Thu Jun 20, 2019 9:34 am
Re: Smpp Dissconnect and re connect
can you tell me what error to take on the dissconnect event?from which object?
Re: Smpp Dissconnect and re connect
I need entries from internal library logger, at lease for the error level.
https://docs.inetlab.com/smpp/v2/articles/tracing.html
https://docs.inetlab.com/smpp/v2/articles/tracing.html
Re: Smpp Dissconnect and re connect
I'm testing a similar behavior using the demo version of your serveralt wrote: Mon Jan 20, 2020 8:21 am I need entries from internal library logger, at lease for the error level.
https://docs.inetlab.com/smpp/v2/articles/tracing.html
Actual client - from pump 2.8.0, server from the Inetlab.SMPP site SmppServer Demo 2.0.0.0 version for net
1) start the server
2) create SmppClient (as a singleton) with the flag ConnectionRecovery = true,
3) initiate the connection according to your examples
if (await client.ConnectAsync("localhost", 7777))
{
Console.WriteLine("Connected to SMPP server");
BindResp bindResp = await client.BindAsync("login", "password", ConnectionMode.Transceiver);
if (bindResp.Header.Status == CommandStatus.ESME_ROK)
{
Console.WriteLine("Bound with SMPP server");
}
}
4) I call SubmitAsync for the 1st time
var responses = await _client.SubmitAsync(
SMS.ForSubmit()
.Text(text)
.From("1111")
.To("79171234567")
.Coding(DataCodings.UCS2)
.DeliveryReceipt()
);
if (responses.Any(a => a.Client == null))
{
throw new SmppConnectionException("Is lost connect");
}
4) restart the server
5) I call the 2nd time SubmitAsync
6) connection restored - all messages reached the server
-----------------
this is like an ideal situation, but in life everything is different, so I send a lot of messages from different flows
at this time I restart the server
as a result, the connection is not restored how much do not wait
sometimes such an error arrives
04.05.2020 16:46:02:ERROR: 80: (SmppClient42.Socket) Connection failed. Unexpected error. Exception: System.TimeoutException: The operation has timed out.
at Inetlab.SMPP.Common.TaskExtensions.TimeoutAfter(Task task, TimeSpan timeout)
at Inetlab.SMPP.Common.SmppSocket.???
Re: Smpp Dissconnect and re connect
What version of the .NET Framework your application targets?
Do you see following log message after this error?zaikay wrote: Mon May 04, 2020 2:32 pm sometimes such an error arrives
04.05.2020 16:46:02:ERROR: 80: (SmppClient42.Socket) Connection failed. Unexpected error. Exception: System.TimeoutException: The operation has timed out.
at Inetlab.SMPP.Common.TaskExtensions.TimeoutAfter(Task task, TimeSpan timeout)
at Inetlab.SMPP.Common.SmppSocket.???
Code: Select all
WARN: Connection failed. Repeat in 120 seconds.
By the way, it is not correct way to check disconnection during submission. You need to check response status:zaikay wrote: Mon May 04, 2020 2:32 pm if (responses.Any(a => a.Client == null))
{
throw new SmppConnectionException("Is lost connect");
}
Code: Select all
response.Any(r=>r.Header.Status == CommandStatus.SMPPCLIENT_NOCONN)
Re: Smpp Dissconnect and re connect
client use .Net Core 3.1What version of the .NET Framework your application targets?
it is not always visibleDo you see following log message after this error?Code: Select all
WARN: Connection failed. Repeat in 120 seconds.
ok thanks, but that doesn't matterBy the way, it is not correct way to check disconnection during submission. You need to check response status:Code: Select all
response.Any(r=>r.Header.Status == CommandStatus.SMPPCLIENT_NOCONN)
example
https://www.dropbox.com/s/5nq1wc0x3w3d5 ... le.7z?dl=0
Code: Select all
static async Task Main(string[] args)
{
LogManager.SetLoggerFactory(new ConsoleLogFactory(LogLevel.Error));
Enumerable.Range(1, 10000).AsParallel().ForAll(async i => await SmsSenderSingelton.SendMessageAsync($"message #{i}"));
Console.ReadKey();
}
Re: Smpp Dissconnect and re connect
thank you for the example. I'll check this case.
Re: Smpp Dissconnect and re connect
Hi zaikay,
What do you want to achieve when you do call like:
Is it only batch sending of the 10000 messages? Or is it stress test for the ThreadPool?
What do you want to achieve when you do call like:
Code: Select all
Enumerable.Range(1, 10000).AsParallel().ForAll(async i => await SmsSenderSingelton.SendMessageAsync($"message #{i}"));
Re: Smpp Dissconnect and re connect
I need to use one client for the REST API service, so I test the stability of batch sending from different threadsalt wrote: Wed May 06, 2020 11:28 am Hi zaikay,
What do you want to achieve when you do call like:Is it only batch sending of the 10000 messages? Or is it stress test for the ThreadPool?Code: Select all
Enumerable.Range(1, 10000).AsParallel().ForAll(async i => await SmsSenderSingelton.SendMessageAsync($"message #{i}"));
because notifications of receipt arrive only at the first client
Re: Smpp Dissconnect and re connect
I have published pre-release version 2.8.1-beta-2015.
You can download it from your Inetlab Account or as NuGet package.
Please test it.
You can download it from your Inetlab Account or as NuGet package.
Please test it.
Re: Smpp Dissconnect and re connect
Hi, thanks! In the nuggets I saw a new version, I'm going to try tomorrow.alt wrote: Fri May 08, 2020 12:28 pm I have published pre-release version 2.8.1-beta-2015.
You can download it from your Inetlab Account or as NuGet package.
Please test it.
Re: Smpp Dissconnect and re connect
The first time did not work.alt wrote: Fri May 08, 2020 12:28 pm I have published pre-release version 2.8.1-beta-2015.
You can download it from your Inetlab Account or as NuGet package.
Please test it.
Steps:
1) SMPP server did not reboot
2) Recompiled client with new beta
3) Connection recovery does not work
4) Restarting the SMPP server
5) Connection recovery now works
Re: Smpp Dissconnect and re connect
Could you test the version 2.8.1-beta-2021 as well? There are some improvements for connection recovery.