public class SMPPServerSessionListener extends Object
SMPPServerSession session = listener.accept(); BindRequest bindReq = session.waitForBind(5000); if (checkPassword(bindReq)) { bindReq.accept("sys"); } else { bindReq.reject(SMPPConstant.STAT_ESME_RINVPASWD); }
The listening trough getting the bind request should take less than session initiation timer, otherwise if there is network open has been requested, ESME will close the connection. Accepting the bind request should take less than transaction timer or ESME will issued timeout.
Constructor and Description |
---|
SMPPServerSessionListener(int port) |
SMPPServerSessionListener(int port,
int timeout,
int backlog,
ServerConnectionFactory serverConnFactory) |
SMPPServerSessionListener(int port,
int timeout,
ServerConnectionFactory serverConnFactory) |
SMPPServerSessionListener(int port,
ServerConnectionFactory serverConnFactory) |
Modifier and Type | Method and Description |
---|---|
SMPPServerSession |
accept()
Accept session request from client.
|
void |
close() |
int |
getInitiationTimer() |
ServerMessageReceiverListener |
getMessageReceiverListener() |
int |
getPduProcessorDegree() |
int |
getPort() |
SessionStateListener |
getSessionStateListener() |
int |
getTimeout(int timeout) |
void |
setInitiationTimer(int initiationTimer) |
void |
setMessageReceiverListener(ServerMessageReceiverListener messageReceiverListener) |
void |
setPduProcessorDegree(int pduProcessorDegree) |
void |
setResponseDeliveryListener(ServerResponseDeliveryListener responseDeliveryListener) |
void |
setSessionStateListener(SessionStateListener sessionStateListener) |
void |
setTimeout(int timeout)
Timeout listening.
|
public SMPPServerSessionListener(int port) throws IOException
IOException
public SMPPServerSessionListener(int port, ServerConnectionFactory serverConnFactory) throws IOException
IOException
public SMPPServerSessionListener(int port, int timeout, ServerConnectionFactory serverConnFactory) throws IOException
IOException
public SMPPServerSessionListener(int port, int timeout, int backlog, ServerConnectionFactory serverConnFactory) throws IOException
IOException
public int getTimeout(int timeout) throws IOException
IOException
public void setTimeout(int timeout) throws IOException
SocketTimeoutException
will be thrown but the
listener still valid.timeout
- IOException
public void setPduProcessorDegree(int pduProcessorDegree)
public int getPduProcessorDegree()
public int getPort()
public int getInitiationTimer()
public void setInitiationTimer(int initiationTimer)
public SessionStateListener getSessionStateListener()
public void setSessionStateListener(SessionStateListener sessionStateListener)
public ServerMessageReceiverListener getMessageReceiverListener()
public void setMessageReceiverListener(ServerMessageReceiverListener messageReceiverListener)
public void setResponseDeliveryListener(ServerResponseDeliveryListener responseDeliveryListener)
public SMPPServerSession accept() throws IOException
SMPPServerSession session = listener.accept(); BindRequest bindReq = session.waitForBind(5000); if (checkPassword(bindReq)) { bindReq.accept("sys"); } else { bindReq.reject(SMPPConstant.STAT_ESME_RINVPASWD); }
SMPPServerSession
.SocketTimeoutException
- if timeout reach with no session accepted.IOException
- if there is an IO error occur.SMPPServerSession
,
BindRequest
public void close() throws IOException
IOException