Table of Contents

Class SmppClientExtensions

Namespace
Inetlab.SMPP
Assembly
Inetlab.SMPP.dll

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 SmppClient
connectionOptions SmppClientConnectionOptions
systemId string
password string
retryDelay TimeSpan
connectionMode ConnectionMode
retryCount int
token CancellationToken

Returns

Task<BindResp>

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 SmppClient
connectionOptions SmppClientConnectionOptions
retryDelay TimeSpan

Returns

Task

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 SmppClient
connectionOptions SmppClientConnectionOptions
retryDelay TimeSpan
retryCount int

Returns

Task

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 SmppClient
connectionOptions SmppClientConnectionOptions
retryDelay TimeSpan
retryCount int
token CancellationToken

Returns

Task

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 SmppClient
endPoint EndPoint
retryDelay TimeSpan

Returns

Task

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 SmppClient
endPoint EndPoint
retryDelay TimeSpan
retryCount int

Returns

Task

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 SmppClient
endPoint EndPoint
retryDelay TimeSpan
retryCount int
token CancellationToken

Returns

Task

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 SmppClient
host string
port int
retryDelay TimeSpan

Returns

Task

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 SmppClient
host string
port int
retryDelay TimeSpan
retryCount int

Returns

Task

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 SmppClient
host string
port int
retryDelay TimeSpan
retryCount int
token CancellationToken

Returns

Task

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 SmppClient
batch 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 SmppClient

The client bound to SMPP server. The ConnectionRecovery property must be enabled.

request SubmitSm

The SubmitSm PDU.

repeatDelay TimeSpan

The 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 SmppClient

The client bound to SMPP server. The ConnectionRecovery property must be enabled.

request SubmitSm

The SubmitSm PDU.

repeatDelay TimeSpan

The time the method should wait before repeat unsuccess PDUs.

cancellationToken CancellationToken

The 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 SmppClient

The client bound to SMPP server. The ConnectionRecovery property must be enabled.

requests IEnumerable<SubmitSm>

The batch of SubmitSm PDUs.

repeatDelay TimeSpan

The 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 SmppClient

The client bound to SMPP server. The ConnectionRecovery property must be enabled.

requests IEnumerable<SubmitSm>

The batch of SubmitSm PDUs.

repeatDelay TimeSpan

The time the method should wait before repeat unsuccess PDUs.

cancellationToken CancellationToken

The 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 and waits until client recovers the connection.