Socket.Dispose() is an inaccessible member. However, we can bypass this by doing the following:
((IDisposible)Socket).Dispose()
Two questions:
- Why is this allowed?
- How does this work internally?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe this feature is ‘explicit interface implementation.’ Using this will only allow the implemented methods to be called if the object is explicitly cast to the interface.
Here’s a tutorial on this:
http://msdn.microsoft.com/en-us/library/aa288461(VS.71).aspx