sacOO7 / SocketclusterClientDotNet

C# client for socketcluster framework in node.js

Home Page:http://socketcluster.io/#!/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emit is not being received SocketCluster v16

jnschultz opened this issue · comments

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

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 ..