简体   繁体   中英

TCP Socket connections in c# closes automatically

I have a TCP socket programming code which runs in WebApi 2.0 , I created a socket pool which has collection of connected sockets to Remote host.. I have also implemented a polling mechanism with Remote TCP host

When I run it from my workstation ( PC ) via Visual Studio , Socket pool is always open and Polling continues with no issues

But when I host it in Server 2012 in IIS, it stops exactly after an hour. I don't know how to start debugging or how to check the differences in behavior. Any help is very much appreciated.

Thanks

It sounds like the IIS App Pool may be getting recycled (thus dropping your connections) for some reason. Take a look at this page for a number of potential things too look for: https://blogs.msdn.microsoft.com/johan/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM