Closed jnschultz closed 4 years ago
I believe I found the issue.. I was placing my .Connect() in the constructor [this was an API call] .. I moved that into the api function .. I had to place a Thread.Sleep(2000) as your example did.. then I called the Disconnect after the Emit and another Sleep ..
on C# client.. SocketMessage sockeMessage = new SocketMessage(); sockeMessage.MessageType = "PatientTestResult"; sockeMessage.PatientId = (long)testResult.PatientId; sockeMessage.DoctorId = doctor.Id; socket.Emit("inbound", sockeMessage);
on sever side
(async () => { for await (let {socket} of agServer.listener('connection')) { console.log(
connection: ${socket}
); (async () => {for await ( let data of socket.receiver('inbound') ) { console.log(
inbound channel: ${data}
);(async () => { try { await socket.exchange.invokePublish('outbound', data); } catch (error) { // ... Handle potential error if broker does not acknowledge before timeout. console.log(
error: ${error}
);} })(); } })(); } }) ();
I never seem to receive 'inbound' on sever