Proper disposal of WebSocket in a WebSocketContext

拟墨画扇 提交于 2019-12-05 18:30:19

You should not dispose the web socket. In fact you cannot. AspNetWebSocket.Dispose always throws a NotSupportedException. The summary and exception sections of the MSDN documentation are incorrect. Fortunately, the remarks section is helpful:

ASP.NET automatically calls the Dispose method on a AspNetWebSocket object to release any resources that remain after your code has finished executing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!