SmppClient
public class SmppClient
Extends: java.lang.Object
SmppClient represents the active-side SMPP connection handler, responsible for managing outbound SMPP sessions from a client to an external SMSC. It handles session creation, state management, automatic channel recovery, and PDU-level communication.
Fields:
debugLogger, logger
Constructor:
public SmppClient(
Boolean isEpoll,
SmppSessionListener callbackInterface,
Integer maxChannels,
SmppSessionConfiguration configuration,
Long enquiryTimeout,
EventLoopGroup acceptorGroup,
PeriodicQueuedTasks<Timer> timersQueue
)
Initializes a new client instance with the following:
isEpoll: Whether to use epoll-based networking (Linux-specific).
callbackInterface: Listener interface for handling session events.
maxChannels: Max simultaneous connections the client may maintain.
configuration: Session settings for binds, credentials, etc.
enquiryTimeout: Frequency (in ms) for sending EnquireLink to maintain the session.
acceptorGroup: Netty event loop group for channel handling.
timersQueue: Queue for managing timer-based tasks like expiry checks.
Methods:
void startClient() | Starts the SMPP client logic and prepares it for establishing sessions. |
void stopClient() | Gracefully stops the client, releasing channels and shutting down sessions. |
Boolean isUp() | Returns true if the client is active and at least one channel is connected. |
void startChannel(SmppSessionImpl oldSession) | Starts a new Netty channel for a session (used internally or for failover). |
void restartChannel(SmppSessionImpl oldSession) | Re-establishes a channel after an error or disconnection. |
Long getEnquiryTimeout() | Retrieves the currently configured EnquireLink timeout interval. |
void channelConnected(Channel channel) | Called when a Netty channel is successfully connected. |
void sessionBound(SmppSessionImpl session) | Called after a session completes a successful bind. |
void send(Pdu pdu) |
Sends a PDU to the SMSC. Throws: RecoverablePduException, UnrecoverablePduException, SmppTimeoutException, SmppChannelException if sending fails due to various recoverable/unrecoverable conditions. |
SmppClient should be run on a single-threaded event loop to avoid concurrency issues.
The SmppSessionListener is required to handle events like bindRequested() and sessionBound() from the client’s perspective.
It is useful for auto-reconnect logic and load-balanced binding.
Start innovating with Mobius
What's next? Let's talk!