Class SmppClientBase
Base class that provides common members for SmppClient and SmppServerClient
public abstract class SmppClientBase : IDisposable
- Inheritance
-
SmppClientBase
- Implements
- Derived
- Inherited Members
Properties
EncodingMapper
Gets or sets encoding mapper that manage relation between SMPP Data Coding and .NET Encoding
public EncodingMapper EncodingMapper { get; set; }
Property Value
EnquireLinkInterval
Specifies a period of time when SMPP session status will be checked with EnquireLink command.
public TimeSpan EnquireLinkInterval { get; set; }
Property Value
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
InterfaceVersion
Indicates the version of the SMPP protocol supported by the ESME.
public byte InterfaceVersion { get; set; }
Property Value
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
Metrics
Gets metrics for sent and received PDUs.
public ISmppClientMetrics Metrics { get; }
Property Value
Name
Name of the client. Used for logging.
public string Name { get; set; }
Property Value
ReceiveBufferSize
Gets or sets a value that specifies the size of the receive buffer of the Socket.
public int? ReceiveBufferSize { get; set; }
Property Value
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
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
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
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
SendBufferSize
Gets or sets a value that specifies the size of the send buffer of the Socket.
public int? SendBufferSize { get; set; }
Property Value
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
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
SequenceGenerator
Gets or sets sequence number generator for correlation purposes in SMPP protocol.
public ISequenceGenerator SequenceGenerator { get; set; }
Property Value
Status
Client connection status
public ConnectionStatus Status { get; protected set; }
Property Value
SystemID
Gets ID of the client
public string SystemID { get; protected set; }
Property Value
SystemType
The type of ESME system.
public string SystemType { get; set; }
Property Value
Tag
Gets or sets an object that contains data to associate with the client.
public object Tag { get; set; }
Property Value
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
DisconnectAsync()
Disconnects client from remote endpoint
public virtual Task DisconnectAsync()
Returns
Dispose()
Close connection and release resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
EnquireLink()
[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
EnquireLink(EnquireLink)
[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
EnquireLinkAsync()
Check of the communication path between an ESME and an SMSC.
public Task<EnquireLinkResp> EnquireLinkAsync()
Returns
EnquireLinkAsync(EnquireLink)
Check of the communication path between an ESME and an SMSC.
public Task<EnquireLinkResp> EnquireLinkAsync(EnquireLink pdu)
Parameters
pdu
EnquireLink
Returns
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
SmppResponseThe response PDU
cancellationToken
CancellationToken
Returns
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
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
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
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
UnbindAsync()
Unregister client from SMSC
public Task<UnBindResp> UnbindAsync()
Returns
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
evDisconnected
Occurs when client disconnects
public event DisconnectedEventHandler evDisconnected
Event Type
evEnquireLink
Occurs when received EnquireLink PDU
public event EnquireLinkEventHandler evEnquireLink
Event Type
evPduReceiving
Occurs before processing PDU received from remote endpoint
public event PduEventHandler evPduReceiving
Event Type
evPduSending
Occurs before sending PDU to remote endpoint
public event PduEventHandler evPduSending
Event Type
evUnBind
Occurs when Unbind packet received from SMSC
public event UnBindEventHandler evUnBind