locked
Is Close() an public API for 'Windows::Networking::Sockets::StreamSocketListener'?

    Question

  • From http://msdn.microsoft.com/library/windows/apps/BR226906#methods, the methods in 'Windows::Networking::Sockets::StreamSocketListener' include "Close()".

    However, if I use Close() in my code, it causes compilation errors as folows.

    src\MediaHTTPStreamer.cc(119) : error C2039: 'Close' : is not a member of 'Windows::Networking::Sockets::StreamSocketListener'
            c:\program files (x86)\windows kits\8.0\references\commonconfiguration\neutral\windows.winmd : see declaration of 'Windows::Networking::Sockets::StreamSocketListener'


    • Edited by Renjie Huang Wednesday, August 29, 2012 10:28 PM
    Wednesday, August 29, 2012 10:28 PM

Answers

  • From the documentation for StreamSocketListener.Close :

    The Close method is used by Metro style apps using JavaScript. For apps written using the .NET Framework 4.5 in C# and VB.NET, the Close method is exposed as the Dispose() method on the StreamSocketListener object. For apps written in C++, the Close method will be called when using the delete keyword on the object.
    --Rob
    • Marked as answer by Renjie Huang Wednesday, August 29, 2012 11:10 PM
    Wednesday, August 29, 2012 10:36 PM
    Owner