由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Contiue with my node questions
相关主题
python, 怎么能把 tree存到 memory了 ?How to stop a function in MATLAB?
现在.NET也往Node上转了Re: 请教一道题目
不用jvm也没啥,问题在于你有其他替代品么?请问这道题怎么解决?
发现写JS, D3, nodeJS的很受鄙视啊[合集] 一个链表倒转的问题
fastest way to send 100k http requests in javaC++如何实现graph?
讨论node/angular route的error handling有人set up过 多个node的Cassandra 么? (转载)
node 求算法C++: What is the difference between the two approaches?
node.js: how to post date (from backend socket) to the webCassandra 里的 partition
相关话题的讨论汇总
话题: node话题: backend话题: function话题: stop话题: stopcmd
进入Programming版参与讨论
1 (共1页)
w*s
发帖数: 7227
1
my flow is like this,
browser<-->node<-->backend server doing calculation
node and backend uses socket to chat.
from browser there're start/stop buttons to let backend start/stop the
calculation.
before node asks backend to start/stop, it must query to see if backend is
alive first.
my code is like this
app.get('/stopCmd', function(req, res)
{
socketToBackendServer.write("status", function() {
console.log("Sending:", 'Node asking for STATUS');
});
socketToBackendServer.on("data", function() {
if(status is ok) // pseudo code
{
socketToBackendServer.write("stop", function() {
console.log("Sending:", 'Node sending STOP');
});
} else {
console.log("backend server is NOT ready");
}
});
});
app.get('/startCmd', function(req, res)
{
// do similar things as stopCmd
}
if using the same browser, if i go crazy clicking start/stop... for the "
stopCmd", how to make sure when it queries "status", the response is caught
by its function, not "startCmd"'s ?
it's this line
socketToBackendServer.on("data", function()
Thank you again !
1 (共1页)
进入Programming版参与讨论
相关主题
Cassandra 里的 partitionfastest way to send 100k http requests in java
用pseudo-code 写数据结构问题。讨论node/angular route的error handling
How does YAHOO calculate RSI? (转载)node 求算法
请教registernode.js: how to post date (from backend socket) to the web
python, 怎么能把 tree存到 memory了 ?How to stop a function in MATLAB?
现在.NET也往Node上转了Re: 请教一道题目
不用jvm也没啥,问题在于你有其他替代品么?请问这道题怎么解决?
发现写JS, D3, nodeJS的很受鄙视啊[合集] 一个链表倒转的问题
相关话题的讨论汇总
话题: node话题: backend话题: function话题: stop话题: stopcmd