我刚刚通过nuget进入WebSocketSharp
它的课程WebSocket
实施IDisposable
,但似乎没有Dispose
方法。
怎么可能?我想如果你实现了一个接口,你还必须实现它的所有属性/方法。
答案 0 :(得分:4)
在source的GitHub上:
#region Explicit Interface Implementations
/// <summary>
/// Closes the WebSocket connection, and releases all associated resources.
/// </summary>
/// <remarks>
/// This method closes the connection with <see cref="CloseStatusCode.Away"/>.
/// </remarks>
void IDisposable.Dispose ()
{
close (new CloseEventArgs (CloseStatusCode.Away), true, true, false);
}
#endregion