DEV Community

Discussion on: request-response pattern with socket.io, Am I using anti pattern ?

Collapse
 
smartcodinghub profile image
Oscar

I did hit similar issues with a chat (an example to explore) using SignalR Core. At least, with this abstraction, you can respond when you get a message. I used this for validations like the user doesn't exist, invalid words and things like that. Using this, you can know if the message reached the server, but no if it was delivered to the target user (Although you can know it).

But I think that the first purpose of web sockets is to keep only a connection open with the server and avoid all the overhead (Headers, Cookies, etc...). Using this, with a request-response pattern, doesn't seem necessarily wrong to me if it fits your needs.