Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var nouvelle_conn;
- Step(
- function ha2() {
- if (client._path != null) {
- nouvelle_conn = tcp.createConnection(client._path);
- } else {
- nouvelle_conn = tcp.createConnection(client._port, client._host);
- }
- var self = this;
- sys.puts('end of ha 2');
- nouvelle_conn.on('connect', function() {
- nouvelle_conn.on('data', self);
- });
- },
- function ha3(err, d2, data) {
- nouvelle_conn.removeAllListeners('data');
- nouvelle_conn.setNoDelay(true);
- var decoder = data.toReader();
- status = decoder.int16();
- version = decoder.int16();
- len = decoder.int32();
- console.log('connection to server version ' + version);
- if (version < 1) {
- err = new Error("Invalid Server version");
- throw(err);
- }
- var version_number = Buffer.makeWriter();
- version_number.push.int32(1);
- nouvelle_conn.write(version_number.toBuffer(), '', this);
- sys.puts('end of ha 3');
- },
- function ha4() {
- sys.puts('_connect: ' + sys.inspect(nouvelle_conn));
- sys.puts('end of ha 4');
- return;
- }
- );
- sys.puts('out of step, at least');
Add Comment
Please, Sign In to add comment