public class SMPPServerSessionListener
extends java.lang.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 java.io.IOException
java.io.IOException
public SMPPServerSessionListener(int port, ServerConnectionFactory serverConnFactory) throws java.io.IOException
java.io.IOException
public SMPPServerSessionListener(int port, int timeout, ServerConnectionFactory serverConnFactory) throws java.io.IOException
java.io.IOException
public SMPPServerSessionListener(int port, int timeout, int backlog, ServerConnectionFactory serverConnFactory) throws java.io.IOException
java.io.IOException
public int getTimeout(int timeout) throws java.io.IOException
java.io.IOException
public void setTimeout(int timeout) throws java.io.IOException
SocketTimeoutException
will be thrown but the
listener still valid.timeout
- java.io.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 java.io.IOException
SMPPServerSession session = listener.accept(); BindRequest bindReq = session.waitForBind(5000); if (checkPassword(bindReq)) { bindReq.accept("sys"); } else { bindReq.reject(SMPPConstant.STAT_ESME_RINVPASWD); }
SMPPServerSession
.java.net.SocketTimeoutException
- if timeout reach with no session accepted.java.io.IOException
- if there is an IO error occur.SMPPServerSession
,
BindRequest
public void close() throws java.io.IOException
java.io.IOException