Horacio E | 10 Feb 15:09
Picon
Favicon

Control response time

Hello, I'm trying to implement the following, I want to send a 0200 message and wait 60 seconds for a
response, If I don't get a response by the second 61 I automatically generate a 0420. The thing is when I run
my code, it keeps the connection open waiting for a reply, here's the code I'm using.

        Logger logger = new Logger();
        logger.addListener(new SimpleLogListener(System.out));
        ISOChannel channel = new ASCIIChannel (
                "127.0.0.1", 10000, new ISOBANCARDPackager());

        ((LogSource)channel).setLogger (logger, "test-channel");
        channel.connect();

        ISOMsg m = new ISOMsg();

        m.setMTI("0200");
        m.set ( X, "XXXXXXX");
        .... (Rest of the the fields)

        channel.send(m);
        Thread.sleep(60000);
        ISOMsg r = channel.receive();
        System.out.println("MTI: " + r.getMTI().toString());
        System.out.println("RESPUESTA: " + r.getString(39));
        System.out.println("RAZON: " + r.getString(44));
        channel.disconnect();

 Any ideas? 
Thanks

/// Horacio

      ¡Sé el Bello 51 de People en Español! ¡Es tu oportunidad de Brillar! Sube tus fotos ya. http://www.51bello.com/

[Non-text portions of this message have been removed]

------------------------------------


Gmane