简体   繁体   English

对nodejs服务器的HTTP并发请求给出相同的响应

[英]http concurrent requests to nodejs server giving same response to

while I am requesting two requests(with different login details) to nodejs server concurrently. 当我同时向nodejs服务器请求两个请求(具有不同的登录详细信息)时。 first request is waiting for callback. 第一个请求正在等待回调。 the same time the second request overriding the first request object in nodejs. 同时第二个请求覆盖了nodejs中的第一个请求对象。 once I got the response from call back its aplicable to both requests. 一旦我收到来自回叫的响应,则该响应适用于两个请求。

It's happens for all services in my nodejs server. 我的nodejs服务器中的所有服务都会发生这种情况。

Problem at my side. 我这边的问题。 I did silly mistake 我犯了愚蠢的错误

I was created the variables globally, that's why it's overwrite the objects. 我是全局创建变量的,这就是为什么它会覆盖对象的原因。 Now I made the variable are local, then everything works fine. 现在,我将变量设置为局部变量,然后一切正常。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM