forked from falconair/nodefix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testFIXClient.js
20 lines (18 loc) · 964 Bytes
/
testFIXClient.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var sys = require('sys');
var fix = require("./fix.js");
var session = fix.createClient("FIX.4.2", "initiator", "acceptor", 1234, "localhost");
session.connectAndLogon(1234,'localhost');
/*session.getMessages(function(err, msg){
if(err){
console.log('Err from data store: '+err);
}
else{
console.log('Msg from data store: '+JSON.stringify(msg));
}
});*/
session.on("connect", function(){ console.log("EVENT connect"); });
session.on("end", function(){ console.log("EVENT end"); });
session.on("logon", function(sender, target){ console.log("EVENT logon: "+ sender + ", " + target); });
session.on("logoff", function(sender, target){ console.log("EVENT logoff: "+ sender + ", " + target); });
session.on("incomingmsg", function(sender,target,msg){ console.log("EVENT incomingmsg: "+ JSON.stringify(msg)); });
session.on("outgoingmsg", function(sender,target,msg){ console.log("EVENT outgoingmsg: "+ JSON.stringify(msg)); });