Why am I getting this SocketException in my C# service?

后端 未结 2 1295
傲寒
傲寒 2020-12-07 03:19

I have a service that is responsible for reading and writing from a server. The reading and writing is done in different threads.

The reader thread is active all the

2条回答
  •  悲&欢浪女
    2020-12-07 03:46

    I would also strongly suggest you look at your write thread, and how you are referencing resources related to the Socket. Ie, are you calling Close/Dispose for any NetworkStream or other objects you are using with the Socket? A code sample from the write thread would be helpful if you're still struggling with the problem.

    You might also want to monitor the process memory and handle usage through the task manager.

提交回复
热议问题