Comments (8)
You can use the test client (https://github.com/juks/iso-8583-socket-queue#iso-host-emulation-and-self-test-clients). Just need to point to the upstream. It will send the given packages no matter it there were an exchange, but it is not a big overhead.
from iso-8583-socket-queue.
I think I will add this feature and push it up to you. Would be good with this feature implemented.
Just give me some directions on the following:
- Is there any global object containing information about last transaction?
- Is there any global timer method that runs in the code I can append to?
- Which is the process that "owns and connects" to the host logic files?
from iso-8583-socket-queue.
I thing a good way to start is to start with simple, then move on. The simple point could be in making some improvements to the test client, like configuration options for various packet types and fields. Now it is all hardcoded. Then provide some changeable options for the packet interval.
This will do the basic job: every system administrator will be able to set the interval and the payload being sent periodicaly.
The test client is here: https://github.com/juks/iso-8583-socket-queue/blob/master/lib/testSuite/lib/testClient.js.
The main logic for upstreaming the data is here:
But breaking in there really not worth of keeping one packet one 1 five minutes. There might be some degug complications. Ther should be a timer, and timer-related work and other stuff.On my experience it was always accomplished by just sening this echo packet each X minutes no matter what. By the way, if the ISO host will close the connection — not a big deal, the queue will work fine, we'll reconnect, no packets will get lost.
from iso-8583-socket-queue.
Yes, I think I will just add a timer and send a packet every 5 minute regardless of transactions or not. Will work something out. Thanks!
from iso-8583-socket-queue.
I'm trying to access upstream socket from the host logic:
File: logic/myhost.js
Iso8583Logic.prototype.upstreamEcho = function(stan) {
var now = moment(new Date());
var p = new iso8583Packet();
p.setFields({
0: 1804,
3: "000000",
11: stan,
12: now.format("YYMMDDHHmmss"),
24: 831,
32: "01008600998"
});
this.upstream.socket.write(p); // <---- how do I reach socket for upstream in this function?
}
/Users/xxxxx/iso-8583-socket-queue/lib/iso8583/lib/logic/myhost.js:171
this.socket.write(Buffer.concat(p));
^
TypeError: Cannot read property 'write' of undefined
at Iso8583Logic.upstreamEcho (/Users/xxxxx/iso-8583-socket-queue/lib/iso8583/lib/logic/myhost.js:171:15)
from iso-8583-socket-queue.
You can do this.upstream.sendData(this, p);
from iso-8583-socket-queue.
Hi @cavebring
I think we deal with same iso host system. I was made some customization in order to deal with my host to.
First you have to define the echotest iso logic in your global logic.
Then in the upstream.js, Try this for periodic echo test:
var echoTestTimout = 300000; // 300000 correspond to 5min in ms
var echoTest = parent.logic.sentUpstreamEcho();
dd('Key exchange ok ...Sent first echo test request to Upstream ....' , 'verbose');
dd('-----------------' + echoTest.pretty(), 'verbose');
if (echoTest) this.write(echoTest.getMessage({
staticHeader: global.c['useStaticHeader'],
lengthHeader: global.c['useLengthHeader']
}));
setTimeout(function() {
dd('Sent echo test request to Upstream ..../5min after..' , 'verbose');
dd('-----------------' + echoTest.pretty(), 'verbose');
if (echoTest) this.write(echoTest.getMessage({
staticHeader: global.c['useStaticHeader'],
lengthHeader: global.c['useLengthHeader']
}));
}.bind(this)
, echoTestTimout);
from iso-8583-socket-queue.
Lovely, thank you @scalpovich !
from iso-8583-socket-queue.
Related Issues (20)
- I managed to connect to the server but when i send a request i am getting no authorisation, can you please assist HOT 2
- how to config format message as 2 byte length + TPDU + BITMAP + DATA HOT 1
- Add a dynamic header in packager HOT 4
- Authentication on connection start HOT 6
- iso20022 support HOT 4
- How to run sv_*_header.txt samples HOT 2
- New Feature Request: Add Agent Proxy HOT 3
- Problem encode RAW packet [Length] HOT 1
- error while trying https JSON request HOT 2
- Incorrect bitmap length when using binary instead of Hex HOT 8
- Listening to host messages from socket queue HOT 2
- Processing Code [3]..............................NaN HOT 1
- Communication Link Using SocketQueue HOT 2
- DE55 before pack HOT 1
- ascii data receive from POS client processing HOT 3
- connect to a server with certificat auth need
- Package errors HOT 7
- Big Endian Length Header Requirement with BCH encoding
- Iso8583 packet is expired. Won't queue! HOT 1
- How to send MIT 800 with header ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iso-8583-socket-queue.