Class SmppClientBase
- Namespace
- Inetlab.SMPP.Common
- Assembly
- cs.temp.dll.dll
Base class that provides common members for SmppClient and SmppServerClient
public abstract class SmppClientBase : IDisposable
- Inheritance
-
ObjectSmppClientBase
- Derived
Fields
Logger
public ILog Logger
Field Value
- ILog
Properties
AddressEncoding
Defines default encoding for source and destination addresses in all PDUs. By default takes encoding for DataCodings.Default.
public Encoding AddressEncoding { get; set; }
Property Value
- Encoding
AddressRange
Identifies a set of SME addresses (short codes, phone number) for which you are receiving messages.
Regular Expression notation should be used to specify a range of addresses.
public string AddressRange { get; set; }
Property Value
- String
AddrNpi
Numbering Plan Indicator for adresses in AddressRange.
public byte AddrNpi { get; set; }
Property Value
- Byte
AddrTon
Indicates Type of Number for adresses in AddressRange.
public byte AddrTon { get; set; }
Property Value
- Byte
Connected
Gets whether the ESME connected to SMSC
public bool Connected { get; }
Property Value
- Boolean
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
EnquireLinkInterval
Specifies a period of time when SMPP session status will be checked with EnquireLink command.
public TimeSpan EnquireLinkInterval { get; set; }
Property Value
- TimeSpan
InactivityTimeout
Specifies the maximum period after which time, if no SMPP messages are exchanged, the SMPP session may be dropped gracefully. Default is 2 minutes.
public TimeSpan InactivityTimeout { get; set; }
Property Value
- TimeSpan
LocalEndPoint
public IPEndPoint LocalEndPoint { get; set; }
Property Value
- IPEndPoint
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.
public QueueState Queue { get; }
Property Value
RaiseEventsInMainThread
Helps to run SMPP events in main (UI) thread.
public bool RaiseEventsInMainThread { get; set; }
Property Value
- Boolean
Remarks
When it is true, you don't need to check InvokeRequired in the events handlers
ReceiveBufferSize
public int ReceiveBufferSize { get; set; }
Property Value
- Int32
RemoteEndPoint
public EndPoint RemoteEndPoint { get; }
Property Value
- EndPoint
ResponseTimeout
Get or sets the time in milliseconds to wait for Response PDU
public TimeSpan ResponseTimeout { get; set; }
Property Value
- TimeSpan
SendBufferSize
public int SendBufferSize { get; set; }
Property Value
- Int32
SendSpeedLimit
Specifies a number of messages per second that client sends to the server . Default is 0, that means unlimited number of messages.
public double SendSpeedLimit { get; set; }
Property Value
- Double
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; set; }
Property Value
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
Tag
Gets or sets an object that contains data to associate with the client.
public object Tag { get; set; }
Property Value
- Object
WorkerThreads
Specifies a number of worker threads that process received messages. Default is 3.
public int WorkerThreads { get; set; }
Property Value
- Int32
Methods
Disconnect()
Disconnect client from remote end point
public virtual void Disconnect()
Dispose()
public void Dispose()
Dispose(Boolean)
protected virtual void Dispose(bool disposing)
Parameters
disposing
Boolean
EnquireLink()
Sends ENQUIRE_LINK message. This message is used to provide a confidence check of the communication path between an ESME and an SMSC.
public EnquireLinkResp EnquireLink()
Returns
EnquireLink(EnquireLink)
Sends ENQUIRE_LINK message. This message is used to provide a confidence check of the communication path between an ESME and an SMSC.
public EnquireLinkResp EnquireLink(EnquireLink req)
Parameters
req
EnquireLink
Returns
EnquireLinkAsync(EnquireLink)
Sends ENQUIRE_LINK message, asynchronously.
public void EnquireLinkAsync(EnquireLink req)
Parameters
req
EnquireLink
Finalize()
protected void Finalize()
GetMappedEncoding(DataCodings)
Returns mapped Encoding for specified dataCoding. If dataCoding not found in mapped encodings, returns Encoding.Default
public Encoding GetMappedEncoding(DataCodings dataCoding)
Parameters
dataCoding
DataCodings
Returns
- Encoding
GetMessageBytes(String, DataCodings)
Converts string to short message bytes for specified data coding.
public byte[] GetMessageBytes(string message, DataCodings dataCoding)
Parameters
message
StringdataCoding
DataCodings
Returns
- Byte[]
GetMessageText(SmppPDU)
Gets text from message.
public string GetMessageText(SmppPDU pdu)
Parameters
pdu
SmppPDU
Returns
- String
GetMessageText(Byte[], DataCodings)
Converts sort message buffer to unicode string using specified data coding.
public string GetMessageText(byte[] buffer, DataCodings dataCoding)
Parameters
buffer
Byte[]dataCoding
DataCodings
Returns
- String
MapEncoding(DataCodings, Encoding)
Assigns SMPP data coding to characters encoding represented by class inherited from Encoding class
public void MapEncoding(DataCodings dataCoding, Encoding encoding)
Parameters
dataCoding
DataCodingsencoding
Encoding
OnPduReceiving(SmppPDU)
protected void OnPduReceiving(SmppPDU pdu)
Parameters
pdu
SmppPDU
OnPduRejected(SmppPDU)
protected void OnPduRejected(SmppPDU pdu)
Parameters
pdu
SmppPDU
OnPduSending(SmppPDU)
protected void OnPduSending(SmppPDU pdu)
Parameters
pdu
SmppPDU
ResetConnection()
Reset connection. Sends RST to remote side.
public virtual void ResetConnection()
SubmitData(IList<DataSm>)
Sends DATA_SM message collection
public IList<DataSmResp> SubmitData(IList<DataSm> dataList)
Parameters
dataList
IList<DataSm>
Returns
- IList<DataSmResp>
SubmitData(DataSm)
Sends DATA_SM message
public DataSmResp SubmitData(DataSm data)
Parameters
data
DataSm
Returns
ToString()
public override string ToString()
Returns
- String
UnBind()
Unregister client from SMSC
public UnBindResp UnBind()
Returns
UnBindAsync(UnBind)
Unregister client from SMSC, asynchronously.
public void UnBindAsync(UnBind pdu)
Parameters
pdu
UnBind
Events
evConnected
Occurs when ESME connected to SMSC
public event ConnectedEventHandler evConnected
Event Type
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
evEnquireLinkComplete
Occurs when ENQUIRE_LINK_RESP packet received from remote side
public event EnquireLinkRespEventHandler evEnquireLinkComplete
Event Type
evGenericNack
Occurs when received GenericNack PDU
public event GenericNackEventHandler evGenericNack
Event Type
evPduReceiving
Occurs before processing PDU received from remote endpoint
public event PduEventHandler evPduReceiving
Event Type
evPduRejected
Occurs when sending PDU not possible. For example SmppClient disconnected.
public event PduEventHandler evPduRejected
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
Event Type
evUnBindComplete
Occurs when UNBIND_RESP packet received from SMSC
public event UnBindRespEventHandler evUnBindComplete