Project Detail

opensmpp SMPPTestPDUEventListener do deliver_sm_resp  

opensmpp SMPPTestPDUEventListener do deliver_sm_resp is project number 336885
posted at GetAFreelancer.com. Click here to post your own project.

 

Bookmark and Share
Free Trial For New Buyers
 

Status: Closed
(Cancelled by Service Buyer)

Selected Providers: -

Budget: $30-250

Created: 10/31/2008 at 7:37 EDT

Bid Count: 1

Average Bid: N/A

11/01/2008 at 7:37 EDT

Project Creator: cometta View PM Post PM
Employer Rating: (No Feedback Yet)

Bid On This Project
 

Description

need consulation how to do deliver_sm_resp after receive deliver_sm in async mode opensmpp . consultation usd10. below is the listener class


private class SMPPTestPDUEventListener extends SmppObject implements ServerPDUEventListener {
Session session;
Queue requestEvents = new Queue();

public SMPPTestPDUEventListener(Session session) {
this.session = session;
}

public void handleEvent(ServerPDUEvent event) {
PDU pdu = event.getPDU();
if (pdu.isRequest()) {
System.out.println("async request received, enqueuing " + pdu.debugString());

if( pdu instanceof DeliverSM ){



System.out.println("****" + " " + ((DeliverSM) pdu).debugString());



}





synchronized (requestEvents) {
requestEvents.enqueue(event);
requestEvents.notify();
}
} else if (pdu.isResponse()) {
System.out.println("async response received " + pdu.debugString());


if( pdu instanceof SubmitSMResp ){


System.out.println ( ">>>" + ((SubmitSMResp) pdu).getMessageId() +" "+ ((SubmitSMResp) pdu).debugString());


}



} else {
System.out.println(
"pdu of unknown class (not request nor " + "response) received, discarding " + pdu.debugString());
}
}

/**
* Returns received pdu from the queue. If the queue is empty,
* the method blocks for the specified timeout.
*/
public ServerPDUEvent getRequestEvent(long timeout) {
ServerPDUEvent pduEvent = null;
synchronized (requestEvents) {
if (requestEvents.isEmpty()) {
try {
requestEvents.wait(timeout);
} catch (InterruptedException e) {
// ignoring, actually this is what we're waiting for
}
}
if (!requestEvents.isEmpty()) {
pduEvent = (ServerPDUEvent) requestEvents.dequeue();
}
}
return pduEvent;
}
}



Messages Posted: 0 View project clarification board Post message on project clarification board

Bid On This Project
 
If you are the project creator or one of the bidders Log In for more options
Bids are hidden by the project creator. Log in as the project creator or as one of the bidders to view bids. You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.

    Bid on this Project