Package com.cloudhopper.smpp.pdu

Examples of com.cloudhopper.smpp.pdu.EnquireLink


        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        try {
            // NOTE: send enquireLink but receive an unbind resp (with same sequence #)
            EnquireLink el0 = new EnquireLink();
            el0.setSequenceNumber(0x1000);

            UnbindResp ubResp = new UnbindResp();
            ubResp.setSequenceNumber(el0.getSequenceNumber());

            // schedule this response on the simulator
            simulator0.addPduToWriteOnNextPduReceived(ubResp);

            // send asynchronously (no response will be received yet)
View Full Code Here


        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        try {
            // NOTE: send enquireLink but receive an unbind resp (with same sequence #)
            EnquireLink el0 = new EnquireLink();
            el0.setSequenceNumber(0x1000);

            UnbindResp ubResp = new UnbindResp();
            ubResp.setSequenceNumber(el0.getSequenceNumber());

            // schedule this response on the simulator
            simulator0.addPduToWriteOnNextPduReceived(ubResp);

            PduResponse pdu0 = null;
View Full Code Here

        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        try {
            // NOTE: send enquireLink but receive an unbind resp (with same sequence #)
            EnquireLink el0 = new EnquireLink();
            el0.setSequenceNumber(0x1000);

            UnbindResp ubResp = new UnbindResp();
            ubResp.setSequenceNumber(el0.getSequenceNumber());

            // schedule this response on the simulator
            simulator0.addPduToWriteOnNextPduReceived(ubResp);

            // send this PDU asynchronously
View Full Code Here

        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        try {
            EnquireLink el0 = new EnquireLink();
            el0.setSequenceNumber(0x1001);
            EnquireLinkResp el0Resp = el0.createResponse();

            // send a request and wait for a response that never shows up
            WindowFuture future = session.sendRequestPdu(el0, 50, true);
            Assert.assertFalse(future.await());
            // a call to cancel() is usually done in sendRequestPduAndGetResponse
View Full Code Here

        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        try {
            EnquireLink el0 = new EnquireLink();
            el0.setSequenceNumber(0x1000);
            EnquireLinkResp el0Resp = el0.createResponse();

            // send a response to a request that was NEVER sent
            simulator0.sendPdu(el0Resp);

            // we should have received a PDU response
View Full Code Here

        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        try {
            try {
                session.enquireLink(new EnquireLink(), 100);
                // request should timeout
                Assert.fail();
            } catch (SmppTimeoutException e) {
                // correct behavior
            }
View Full Code Here

        SmppSimulatorSessionHandler simulator0 = server.pollNextSession(1000);
        simulator0.setPduProcessor(null);

        // load up the "window" with a request
        session.sendRequestPdu(new EnquireLink(), 5000, false);
       
        Assert.assertEquals(1, session.getSendWindow().getSize());
       
        // make sure that a shutdown request performs all expected cleanup
        session.destroy();
View Full Code Here

           
            System.out.println("Press any key to send enquireLink #1");
            System.in.read();

            // demo of a "synchronous" enquireLink call - send it and wait for a response
            EnquireLinkResp enquireLinkResp1 = session0.enquireLink(new EnquireLink(), 10000);
            logger.info("enquire_link_resp #1: commandStatus [" + enquireLinkResp1.getCommandStatus() + "=" + enquireLinkResp1.getResultMessage() + "]");
           
            System.out.println("Press any key to send enquireLink #2");
            System.in.read();

            // demo of an "asynchronous" enquireLink call - send it, get a future,
            // and then optionally choose to pick when we wait for it
            WindowFuture<Integer,PduRequest,PduResponse> future0 = session0.sendRequestPdu(new EnquireLink(), 10000, true);
            if (!future0.await()) {
                logger.error("Failed to receive enquire_link_resp within specified time");
            } else if (future0.isSuccess()) {
                EnquireLinkResp enquireLinkResp2 = (EnquireLinkResp)future0.getResponse();
                logger.info("enquire_link_resp #2: commandStatus [" + enquireLinkResp2.getCommandStatus() + "=" + enquireLinkResp2.getResultMessage() + "]");
View Full Code Here

                        session0 = bootstrap.bind(config0, sessionHandler);

                        Thread.sleep(10);

                        //
                        session0.enquireLink(new EnquireLink(), 10000);

                        Thread.sleep(10);

                        session0.close();
View Full Code Here

           
            System.out.println("Press any key to send enquireLink #1");
            System.in.read();

            // demo of a "synchronous" enquireLink call - send it and wait for a response
            EnquireLinkResp enquireLinkResp1 = session0.enquireLink(new EnquireLink(), 10000);
            logger.info("enquire_link_resp #1: commandStatus [" + enquireLinkResp1.getCommandStatus() + "=" + enquireLinkResp1.getResultMessage() + "]");
           
            System.out.println("Press any key to send enquireLink #2");
            System.in.read();

            // demo of an "asynchronous" enquireLink call - send it, get a future,
            // and then optionally choose to pick when we wait for it
            WindowFuture<Integer,PduRequest,PduResponse> future0 = session0.sendRequestPdu(new EnquireLink(), 10000, true);
            if (!future0.await()) {
                logger.error("Failed to receive enquire_link_resp within specified time");
            } else if (future0.isSuccess()) {
                EnquireLinkResp enquireLinkResp2 = (EnquireLinkResp)future0.getResponse();
                logger.info("enquire_link_resp #2: commandStatus [" + enquireLinkResp2.getCommandStatus() + "=" + enquireLinkResp2.getResultMessage() + "]");
View Full Code Here

TOP

Related Classes of com.cloudhopper.smpp.pdu.EnquireLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.