Class SmppClientExtensions
Extension methods for SmppClient
public static class SmppClientExtensions
- Inheritance
-
SmppClientExtensions
- Inherited Members
Methods
RetryUntilBindAsync(SmppClient, SmppClientConnectionOptions, string, string, TimeSpan, ConnectionMode, int, CancellationToken)
Tries to bind to SMPP server until success.
public static Task<BindResp> RetryUntilBindAsync(this SmppClient client, SmppClientConnectionOptions connectionOptions, string systemId, string password, TimeSpan retryDelay, ConnectionMode connectionMode = ConnectionMode.Transceiver, int retryCount = 2147483647, CancellationToken token = default)
Parameters
clientSmppClientconnectionOptionsSmppClientConnectionOptionssystemIdstringpasswordstringretryDelayTimeSpanconnectionModeConnectionModeretryCountinttokenCancellationToken
Returns
Exceptions
- SmppConnectionException
When Bind returns status other than ESME_ROK, ESME_RALYBND, SMPPCLIENT_NOCONN, SMPPCLIENT_RCVTIMEOUT.
- SmppConnectionException
When retry attempts are exceeded.
RetryUntilConnectedAsync(SmppClient, SmppClientConnectionOptions, TimeSpan)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, SmppClientConnectionOptions connectionOptions, TimeSpan retryDelay)
Parameters
clientSmppClientconnectionOptionsSmppClientConnectionOptionsretryDelayTimeSpan
Returns
RetryUntilConnectedAsync(SmppClient, SmppClientConnectionOptions, TimeSpan, int)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, SmppClientConnectionOptions connectionOptions, TimeSpan retryDelay, int retryCount)
Parameters
clientSmppClientconnectionOptionsSmppClientConnectionOptionsretryDelayTimeSpanretryCountint
Returns
RetryUntilConnectedAsync(SmppClient, SmppClientConnectionOptions, TimeSpan, int, CancellationToken)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, SmppClientConnectionOptions connectionOptions, TimeSpan retryDelay, int retryCount, CancellationToken token)
Parameters
clientSmppClientconnectionOptionsSmppClientConnectionOptionsretryDelayTimeSpanretryCountinttokenCancellationToken
Returns
RetryUntilConnectedAsync(SmppClient, EndPoint, TimeSpan)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, EndPoint endPoint, TimeSpan retryDelay)
Parameters
clientSmppClientendPointEndPointretryDelayTimeSpan
Returns
RetryUntilConnectedAsync(SmppClient, EndPoint, TimeSpan, int)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, EndPoint endPoint, TimeSpan retryDelay, int retryCount)
Parameters
clientSmppClientendPointEndPointretryDelayTimeSpanretryCountint
Returns
RetryUntilConnectedAsync(SmppClient, EndPoint, TimeSpan, int, CancellationToken)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, EndPoint endPoint, TimeSpan retryDelay, int retryCount, CancellationToken token)
Parameters
clientSmppClientendPointEndPointretryDelayTimeSpanretryCountinttokenCancellationToken
Returns
RetryUntilConnectedAsync(SmppClient, string, int, TimeSpan)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, string host, int port, TimeSpan retryDelay)
Parameters
clientSmppClienthoststringportintretryDelayTimeSpan
Returns
RetryUntilConnectedAsync(SmppClient, string, int, TimeSpan, int)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, string host, int port, TimeSpan retryDelay, int retryCount)
Parameters
clientSmppClienthoststringportintretryDelayTimeSpanretryCountint
Returns
RetryUntilConnectedAsync(SmppClient, string, int, TimeSpan, int, CancellationToken)
Tries to connect to SMPP server until success.
public static Task RetryUntilConnectedAsync(this SmppClient client, string host, int port, TimeSpan retryDelay, int retryCount, CancellationToken token)
Parameters
clientSmppClienthoststringportintretryDelayTimeSpanretryCountinttokenCancellationToken
Returns
SubmitBatchAndWaitForDeliveryAsync(SmppClient, IEnumerable<SubmitSm>, TimeSpan)
Submit batch of SubmitSm PDUs and wait for all Delivery receipts.
public static Task<IEnumerable<Tuple<SubmitSmResp, DeliverSm>>> SubmitBatchAndWaitForDeliveryAsync(this SmppClient client, IEnumerable<SubmitSm> batch, TimeSpan deliveryTimeout)
Parameters
clientSmppClientbatchIEnumerable<SubmitSm>deliveryTimeoutTimeSpan
Returns
- Task<IEnumerable<Tuple<SubmitSmResp, DeliverSm>>>
The collection of delivery receipt.
SubmitWithRepeatAsync(SmppClient, SubmitSm, TimeSpan)
Submits a SubmitSm PDU. Repeats the PDU if following response status received: SMPPCLIENT_NOCONN, SMPPCLIENT_RCVTIMEOUT, ESME_RTHROTTLED, ESME_RMSGQFUL, SMPPCLIENT_UNBOUND.
public static Task<SubmitSmResp> SubmitWithRepeatAsync(this SmppClient client, SubmitSm request, TimeSpan repeatDelay)
Parameters
clientSmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
requestSubmitSmThe SubmitSm PDU.
repeatDelayTimeSpanThe time the method should wait before repeat unsuccess PDUs.
Returns
- Task<SubmitSmResp>
Returns SubmitSmResp for each request.
Remarks
Before call this method enable ConnectionRecovery property for the SmppClient and bind it with SMPP server. When client disconnects the method stops to repeat the PDUs and waits until client recovers the connection.
SubmitWithRepeatAsync(SmppClient, SubmitSm, TimeSpan, CancellationToken)
Submits a SubmitSm PDU. Repeats the PDU if following response status received: SMPPCLIENT_NOCONN, SMPPCLIENT_RCVTIMEOUT, ESME_RTHROTTLED, ESME_RMSGQFUL, SMPPCLIENT_UNBOUND.
public static Task<SubmitSmResp> SubmitWithRepeatAsync(this SmppClient client, SubmitSm request, TimeSpan repeatDelay, CancellationToken cancellationToken)
Parameters
clientSmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
requestSubmitSmThe SubmitSm PDU.
repeatDelayTimeSpanThe time the method should wait before repeat unsuccess PDUs.
cancellationTokenCancellationTokenThe token to cancel the method.
Returns
- Task<SubmitSmResp>
Returns SubmitSmResp for each request.
Remarks
Before call this method enable ConnectionRecovery property for the SmppClient and bind it with SMPP server. When client disconnects the method stops to repeat the PDUs and waits until client recovers the connection.
SubmitWithRepeatAsync(SmppClient, IEnumerable<SubmitSm>, TimeSpan)
Submits a batch of SubmitSm PDUs. Repeats the PDU if following response status received: SMPPCLIENT_NOCONN, SMPPCLIENT_RCVTIMEOUT, ESME_RTHROTTLED, ESME_RMSGQFUL, SMPPCLIENT_UNBOUND.
public static Task<IEnumerable<SubmitSmResp>> SubmitWithRepeatAsync(this SmppClient client, IEnumerable<SubmitSm> requests, TimeSpan repeatDelay)
Parameters
clientSmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
requestsIEnumerable<SubmitSm>The batch of SubmitSm PDUs.
repeatDelayTimeSpanThe time the method should wait before repeat unsuccess PDUs.
Returns
- Task<IEnumerable<SubmitSmResp>>
Returns SubmitSmResp for each request.
Remarks
Before call this method enable ConnectionRecovery property for the SmppClient and bind it with SMPP server. When client disconnects the method stops to repeat the PDUs and waits until client recovers the connection.
SubmitWithRepeatAsync(SmppClient, IEnumerable<SubmitSm>, TimeSpan, CancellationToken)
Submits a batch of SubmitSm PDUs. Repeats the PDU if following response status received: SMPPCLIENT_NOCONN, SMPPCLIENT_RCVTIMEOUT, ESME_RTHROTTLED, ESME_RMSGQFUL, SMPPCLIENT_UNBOUND.
public static Task<IEnumerable<SubmitSmResp>> SubmitWithRepeatAsync(this SmppClient client, IEnumerable<SubmitSm> requests, TimeSpan repeatDelay, CancellationToken cancellationToken)
Parameters
clientSmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
requestsIEnumerable<SubmitSm>The batch of SubmitSm PDUs.
repeatDelayTimeSpanThe time the method should wait before repeat unsuccess PDUs.
cancellationTokenCancellationTokenThe token to cancel the method.
Returns
- Task<IEnumerable<SubmitSmResp>>
Returns SubmitSmResp for each request.
Remarks
Before call this method enable ConnectionRecovery property for the SmppClient and bind it with SMPP server. When client disconnects the method stops to repeat the PDUs sending and waits until client recovers the connection.