Table of Contents

Class SmppClientBase

Namespace
Inetlab.SMPP
Assembly
Inetlab.SMPP.dll

Base class that provides common members for SmppClient and SmppServerClient

public abstract class SmppClientBase : IDisposable
Inheritance
SmppClientBase
Implements
Derived
Inherited Members

Constructors

SmppClientBase(string, EncodingMapper)

protected SmppClientBase(string name, EncodingMapper encodingMapper)

Parameters

name string
encodingMapper EncodingMapper

Properties

EncodingMapper

Gets or sets encoding mapper that manage relation between SMPP Data Coding and .NET Encoding

public EncodingMapper EncodingMapper { get; set; }

Property Value

EncodingMapper

EnquireLinkInterval

Specifies a period of time when SMPP session status will be checked with EnquireLink command.

public TimeSpan EnquireLinkInterval { get; set; }

Property Value

TimeSpan

EsmeAddress

The ESME address range. In Address property can be specified a single SME address or a range of SME addresses using UNIX Regular Expression notation.

public SmeAddress EsmeAddress { get; set; }

Property Value

SmeAddress

InterfaceVersion

Indicates the version of the SMPP protocol supported by the ESME.

public byte InterfaceVersion { get; set; }

Property Value

byte

LocalEndPoint

Gets or sets the local end point.

public EndPoint LocalEndPoint { get; protected set; }

Property Value

EndPoint

The local end point.

Logger

public ILog Logger { get; set; }

Property Value

ILog

Metrics

Gets metrics for sent and received PDUs.

public ISmppClientMetrics Metrics { get; }

Property Value

ISmppClientMetrics

Name

Name of the client. Used for logging.

public string Name { get; set; }

Property Value

string

ReceiveBufferSize

Gets or sets a value that specifies the size of the receive buffer of the Socket.

public int? ReceiveBufferSize { get; set; }

Property Value

int?

An int that contains the size, in bytes, of the receive buffer. The default is 65536.

Exceptions

ArgumentOutOfRangeException

The value specified for a set operation is less than 0.

ReceiveSpeedLimit

Specifies a number of messages per second that can be received from remote side. Default is NoLimit, that means unlimited number of messages. If remote side sends faster than defined speed the status ESME_RTHROTTLED will be returned. The value of the property can be always changed.

public LimitRate ReceiveSpeedLimit { get; set; }

Property Value

LimitRate

ReceiveTaskScheduler

Gets or sets the Task scheduler that handles received messages from remote side. By default SmppClientBase class starts 3 worker threads using WorkersTaskScheduler> class.

public TaskScheduler ReceiveTaskScheduler { get; set; }

Property Value

TaskScheduler

ReceivedRequestQueueLimit

Specifies a maximum number of SMPP requests in receive queue. Default is 0 which means not limited.

public int ReceivedRequestQueueLimit { get; set; }

Property Value

int

RemoteEndPoint

Gets the remote endpoint.

public EndPoint RemoteEndPoint { get; protected set; }

Property Value

EndPoint

The remote end point.

ResponseTimeout

Gets or sets the time to wait for a Response on submitted SMPP request.

public TimeSpan ResponseTimeout { get; set; }

Property Value

TimeSpan

SendBufferSize

Gets or sets a value that specifies the size of the send buffer of the Socket.

public int? SendBufferSize { get; set; }

Property Value

int?

An int that contains the size, in bytes, of the send buffer. The default is 65536.

Exceptions

ArgumentOutOfRangeException

The value specified for a set operation is less than 0.

SendQueueLimit

Limits the number of SMPP requests waiting for response from remote side. Default is 0 which means not limited.

public int SendQueueLimit { get; set; }

Property Value

int

Remarks

When remote side cannot process messages fast enough, number of sent messages may exceed queue limit (ESME_RMSGQFUL). In this situation sending to network will be delayed until queue has a free slot (remote side has sent a response).

This property should be set before establishing connection.

SendSpeedLimit

Specifies a number of messages per time unit that client sends to the server . Default is NoLimit, that means unlimited number of messages. The value of the property can be always changed.

public LimitRate SendSpeedLimit { get; set; }

Property Value

LimitRate

SequenceGenerator

Gets or sets sequence number generator for correlation purposes in SMPP protocol.

public ISequenceGenerator SequenceGenerator { get; set; }

Property Value

ISequenceGenerator

Status

Client connection status

public ConnectionStatus Status { get; protected set; }

Property Value

ConnectionStatus

SystemID

Gets ID of the client

public string SystemID { get; protected set; }

Property Value

string

SystemType

The type of ESME system.

public string SystemType { get; set; }

Property Value

string

Tag

Gets or sets an object that contains data to associate with the client.

public object Tag { get; set; }

Property Value

object

Methods

CheckDisposed()

protected void CheckDisposed()

Disconnect()

[Obsolete("Use the DisconnectAsync method. This method will be removed in version 3.0.")]
public virtual Task Disconnect()

Returns

Task

DisconnectAsync()

Disconnects client from remote endpoint

public virtual Task DisconnectAsync()

Returns

Task

Dispose()

Close connection and release resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool
[Obsolete("Use the same method with Async suffix. This method name will be used in version 3.0 for synchronous processing.")]
public Task<EnquireLinkResp> EnquireLink()

Returns

Task<EnquireLinkResp>
[Obsolete("Use the same method with Async suffix. This method name will be used in version 3.0 for synchronous processing.")]
public Task<EnquireLinkResp> EnquireLink(EnquireLink pdu)

Parameters

pdu EnquireLink

Returns

Task<EnquireLinkResp>

EnquireLinkAsync()

Check of the communication path between an ESME and an SMSC.

public Task<EnquireLinkResp> EnquireLinkAsync()

Returns

Task<EnquireLinkResp>

Check of the communication path between an ESME and an SMSC.

public Task<EnquireLinkResp> EnquireLinkAsync(EnquireLink pdu)

Parameters

pdu EnquireLink

Returns

Task<EnquireLinkResp>

Exceptions

InvalidOperationException

Thrown when PDU serialization is failed.

ArgumentNullException

Thrown when request instance is null.

GenericNackSmppException

Thrown when remote side returns negative acknowledgement (GENERIC_NACK) response, which means invalid or unknown command.

SendResponseAsync(SmppResponse, CancellationToken)

Sends response PDU to remote side.

public virtual Task SendResponseAsync(SmppResponse response, CancellationToken cancellationToken = default)

Parameters

response SmppResponse

The response PDU

cancellationToken CancellationToken

Returns

Task

Exceptions

ArgumentNullException

Thrown when response is not defined.

SubmitData(IDataSmBuilder)

[Obsolete("Use the same method with Async suffix. This method name will be used in version 3.0 for synchronous processing.")]
public Task<DataSmResp[]> SubmitData(IDataSmBuilder builder)

Parameters

builder IDataSmBuilder

Returns

Task<DataSmResp[]>

SubmitData(DataSm)

[Obsolete("Use the same method with Async suffix. This method name will be used in version 3.0 for synchronous processing.")]
public Task<DataSmResp> SubmitData(DataSm data)

Parameters

data DataSm

Returns

Task<DataSmResp>

SubmitData(params DataSm[])

[Obsolete("Use the same method with Async suffix. This method name will be used in version 3.0 for synchronous processing.")]
public Task<DataSmResp[]> SubmitData(params DataSm[] pduList)

Parameters

pduList DataSm[]

Returns

Task<DataSmResp[]>

SubmitDataAsync(IDataSmBuilder)

Creates and sends several DATA_SM messages

public Task<DataSmResp[]> SubmitDataAsync(IDataSmBuilder builder)

Parameters

builder IDataSmBuilder

Returns

Task<DataSmResp[]>

Exceptions

ArgumentNullException

When is null

SubmitDataAsync(DataSm)

Sends DATA_SM message

public Task<DataSmResp> SubmitDataAsync(DataSm data)

Parameters

data DataSm

Returns

Task<DataSmResp>

Exceptions

InvalidOperationException

Thrown when PDU serialization is failed.

ArgumentNullException

Thrown when request instance is null.

GenericNackSmppException

Thrown when remote side returns negative acknowledgement (GENERIC_NACK) response, which means invalid or unknown command.

SubmitDataAsync(params DataSm[])

Sends several DATA_SM message

public Task<DataSmResp[]> SubmitDataAsync(params DataSm[] pduList)

Parameters

pduList DataSm[]

Returns

Task<DataSmResp[]>

Exceptions

ArgumentNullException

When is null

ToString()

Returns short information about client instance.

public override string ToString()

Returns

string

UnBind()

[Obsolete("Use the same method with Async suffix. This method name will be used in version 3.0 for synchronous processing.")]
public Task<UnBindResp> UnBind()

Returns

Task<UnBindResp>

UnbindAsync()

Unregister client from SMSC

public Task<UnBindResp> UnbindAsync()

Returns

Task<UnBindResp>

Exceptions

InvalidOperationException

Thrown when PDU serialization is failed.

ArgumentNullException

Thrown when request instance is null.

Events

evDataSm

Occurs when receiving DataSm PDU

public event DataSmEventHandler evDataSm

Event Type

DataSmEventHandler

evDisconnected

Occurs when client disconnects

public event DisconnectedEventHandler evDisconnected

Event Type

DisconnectedEventHandler

Occurs when received EnquireLink PDU

public event EnquireLinkEventHandler evEnquireLink

Event Type

EnquireLinkEventHandler

evPduReceiving

Occurs before processing PDU received from remote endpoint

public event PduEventHandler evPduReceiving

Event Type

PduEventHandler

evPduSending

Occurs before sending PDU to remote endpoint

public event PduEventHandler evPduSending

Event Type

PduEventHandler

evUnBind

Occurs when Unbind packet received from SMSC

public event UnBindEventHandler evUnBind

Event Type

UnBindEventHandler