Is there any sample code or startup documentation about running threads in webapi project. I have group 1 client devices and want them (group 1) to communicate with webapi using tcp communication and have group 2 client devices and want them (group 2) to communicate with webapi using http get/posts. How can i do that?
Is there any sample code or startup documentation about running threads in webapi project.
Share
I strongly discourage you from doing that. WebApi projects (selfhosted excluded) are controlled by the IIS application pool. That means that the project can get closed/restarted at any time.
In other words: You can not guarantee that your TCP listener keeps running in an IIS project.
It sounds more like you want to use WebSockets to communicate with your users.