node与java如何长连接
大家讲道理
大家讲道理 2017-04-18 09:51:16
0
5
430

如果我用ws模块提供一个websocket接口,java放能否正常调用?
有什么好的实现方式?
我用node的http.request 访问 node的http。createServer 是可以长连接(keep-alive)。但是不知道会保持多久,也不知道java 能不能访问到。和我正常交互长连接交互。
我要实现的是 在一个长连接请求中,a 发送一个请求给b,b根据接受到的数据,在发送给a,a在根据接受到数据,发送给b。能一个一个请求实现(这就是长连接吧),需要保持长时间的连接。
有知道大神帮帮解决下。 node与node下我实现了。node与java 我就不知道了

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(5)
PHPzhong

Thrift

黄舟

Is Socket related to the programming language you use? Aren't they all monitoring one address?

阿神

It is recommended that this inter-process communication be solved by a third party, such as Redis, RabbitMQ, Kafka, etc. First, third parties have universal SDK interfaces to solve the problem of language heterogeneity. Second, they can also decouple your node and Java. Third, they have more flexible routing configuration, monitoring and management, etc.

伊谢尔伦

HTTP keep-alive cannot completely guarantee a long chain.

Since you can do low-level protocol programming, why not use socket programming directly? They all support it anyway, so why use a high-level protocol.
Websocket solves the problem of long chains between browsers and servers.

刘奇

Where is the great god? Please answer

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template