Websocket 如何在socket.io中连接和读取来自microservice(TCP)的响应

Websocket 如何在socket.io中连接和读取来自microservice(TCP)的响应,websocket,tcp,microservices,nestjs,tcpclient,Websocket,Tcp,Microservices,Nestjs,Tcpclient,在Nest.js中,我使用tcp体系结构进行微服务通信,在socket.io连接中,我可以连接如下所示的微服务,但我无法读取响应 this.client.emit('getSingleRoom',payload) this.client.send({service:'getSingleRoom'},payload.toPromise() 这两个代码都与microservice连接,但我无法读取此响应,以便在主服务器中发出响应。我正在nest.js中使用web套接字。this.client.sen

在Nest.js中,我使用tcp体系结构进行微服务通信,在socket.io连接中,我可以连接如下所示的微服务,但我无法读取响应

this.client.emit('getSingleRoom',payload)

this.client.send({service:'getSingleRoom'},payload.toPromise()


这两个代码都与microservice连接,但我无法读取此响应,以便在主服务器中发出响应。我正在nest.js中使用web套接字。

this.client.send('sendMessagesInRoom',pay.toPromise()

由于等待批准,无法编辑,但建议您将代码行设置为代码格式。