/** * SMS 결과 수신을 위한 Connection 및 Session 생성한다. * * @throws SMEException */ public void open() throws SMEException { this.factReceiver = new SMEConnectionFactoryImpl(connString); this.connReceiver = factReceiver.createConnection(smsId, smsPwd); // 아이디와 패스워드입니다. this.sessReceiver = connReceiver.createSession(); this.receiver = sessReceiver.createReceiver(); this.receiver.setListener(this); this.connReceiver.start(); isConnected = true; }
/** SMS 결과 수신을 위한 Connection 및 Session 해제한다. */ public void close() { try { if (receiver != null) receiver.close(); } catch (SMEException ignore) { ignore.printStackTrace(); } try { if (sessReceiver != null) sessReceiver.close(); } catch (SMEException ignore) { ignore.printStackTrace(); } try { if (connReceiver != null) connReceiver.close(); } catch (SMEException ignore) { ignore.printStackTrace(); } }