Created
March 20, 2014 09:27
-
-
Save barlowm/9660165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ProcessCommandList(req, res, ProcCmdList) { | |
responseParam = res; | |
var conn = net.createConnection(xData.options.port, xData.options.host); | |
conn.on("connect", function() { | |
initData(ProcCmdList); | |
}); | |
conn.on("data", function(c) { | |
ProcInputData(conn, c, responseParam); | |
}); | |
} | |
function ProcInputData(conn, c, resp) { | |
var data = c + ''; // make sure it's a string | |
if (data.indexOf("Data to look for") >= 0) { | |
console.log("Found it"); | |
} | |
else { | |
// keep looking | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment