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()

Initializes a new instance of the object class.

protected SmppClientBase()

Properties

ConnectionTimeout

Gets or sets the time to wait while trying to establish a connection before terminating the attempt

public TimeSpan ConnectionTimeout { get; set; }

Property Value

TimeSpan

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 IPEndPoint LocalEndPoint { get; set; }

Property Value

IPEndPoint

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

Queue

Returns internal queue state for sent and received PDUs.

[Obsolete("Use Metrics property instead.")]
public QueueState Queue { get; }

Property Value

QueueState

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 8192.

Exceptions

SocketException

An error occurred when attempting to access the socket.

ObjectDisposedException

The Socket has been closed.

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.

public LimitRate ReceiveSpeedLimit { get; set; }

Property Value

LimitRate

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 end point.

public EndPoint RemoteEndPoint { get; }

Property Value

EndPoint

The remote end point.

ResponseTimeout

Get or sets the time in milliseconds to wait for Response PDU

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 8192.

Exceptions

SocketException

An error occurred when attempting to access the socket.

ObjectDisposedException

The Socket has been closed.

ArgumentOutOfRangeException

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

SendQueueLimit

Limits the number of sending SMPP messages to remote side. Default is 0 which means not limited.

public int SendQueueLimit { get; set; }

Property Value

int

SendSpeedLimit

Specifies a number of messages per time unit that client sends to the server . Default is NoLimit, that means unlimited number of messages.

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

Identifies the type requesting to bind with the SMSC.

public string SystemType { get; set; }

Property Value

string

WorkerThreads

Specifies a number of worker threads that process received messages. Default is 3.

public int WorkerThreads { get; set; }

Property Value

int

Methods

Disconnect()

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

Returns

Task

DisconnectAsync()

Disconnects client from remote endpoint

public virtual Task DisconnectAsync()

Returns

Task

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged 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.

OnPduReceiving(SmppPDU)

protected void OnPduReceiving(SmppPDU pdu)

Parameters

pdu SmppPDU

OnPduSending(SmppPDU)

protected void OnPduSending(SmppPDU pdu)

Parameters

pdu SmppPDU

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[]>

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.

SubmitDataAsync(params DataSm[])

Sends several DATA_SM message

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

Parameters

pduList DataSm[]

Returns

Task<DataSmResp[]>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

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

evConnected

Occurs when ESME connected to SMSC

public event ConnectedEventHandler evConnected

Event Type

ConnectedEventHandler

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