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
client
SmppClientconnectionOptions
SmppClientConnectionOptionssystemId
stringpassword
stringretryDelay
TimeSpanconnectionMode
ConnectionModeretryCount
inttoken
CancellationToken
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
client
SmppClientconnectionOptions
SmppClientConnectionOptionsretryDelay
TimeSpan
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
client
SmppClientconnectionOptions
SmppClientConnectionOptionsretryDelay
TimeSpanretryCount
int
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
client
SmppClientconnectionOptions
SmppClientConnectionOptionsretryDelay
TimeSpanretryCount
inttoken
CancellationToken
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
client
SmppClientendPoint
EndPointretryDelay
TimeSpan
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
client
SmppClientendPoint
EndPointretryDelay
TimeSpanretryCount
int
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
client
SmppClientendPoint
EndPointretryDelay
TimeSpanretryCount
inttoken
CancellationToken
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
client
SmppClienthost
stringport
intretryDelay
TimeSpan
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
client
SmppClienthost
stringport
intretryDelay
TimeSpanretryCount
int
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
client
SmppClienthost
stringport
intretryDelay
TimeSpanretryCount
inttoken
CancellationToken
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
client
SmppClientbatch
IEnumerable<SubmitSm>deliveryTimeout
TimeSpan
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
client
SmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
request
SubmitSmThe SubmitSm PDU.
repeatDelay
TimeSpanThe 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
client
SmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
request
SubmitSmThe SubmitSm PDU.
repeatDelay
TimeSpanThe time the method should wait before repeat unsuccess PDUs.
cancellationToken
CancellationTokenThe 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
client
SmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
requests
IEnumerable<SubmitSm>The batch of SubmitSm PDUs.
repeatDelay
TimeSpanThe 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
client
SmppClientThe client bound to SMPP server. The ConnectionRecovery property must be enabled.
requests
IEnumerable<SubmitSm>The batch of SubmitSm PDUs.
repeatDelay
TimeSpanThe time the method should wait before repeat unsuccess PDUs.
cancellationToken
CancellationTokenThe 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.