草庐IT

DisposeLocalCopyOfClientHandle

全部标签

c# - 建立连接后需要调用DisposeLocalCopyOfClientHandle()

与匿名管道建立连接后的步骤需要服务器调用DisposeLocalCopyOfClientHandle。MSDN解释:TheDisposeLocalCopyOfClientHandlemethodshouldbecalledaftertheclienthandlehasbeenpassedtotheclient.Ifthismethodisnotcalled,theAnonymousPipeServerStreamobjectwillnotreceivenoticewhentheclientdisposesofitsPipeStreamobject.为了理解为什么在客户端关闭时服务器不会