The SetSockets method sets the internal and external sockets for the data filter. When this method is called, the filter is expected to begin the data-pumping process between the sockets.
HRESULT SetSockets( [in] IFWXSocket* piInternalSocket, [in] IFWXSocket* piExternalSocket, [in] IFWXConnection* piConnection, [in] IUnknown* punkFilterContext );
Pointer to the IFWXSocket interface for an internal socket.
Pointer to the IFWXSocket interface for an external socket.
Pointer to the IFWXConnection interface on the connection object on which this data filter is installed.
Pointer to the interface used to pass context information to the data filter. The parameter will have the same value as the punkFilterContext parameter of the IFWXConnection::AttachDataFilter and IFWXSession::SetDataFilterFactory methods.
Implementations of this method should return the following:
The method succeeded.
Not enough memory or resources could be allocated to process the event. The connection will be terminated.
The following is an example implementation of the IFWXDataFilter::SetSockets method.
STDMETHODIMP //CDumpData is the name of the object that implements //IFWXDataFilter in this example. CDumpData::SetSockets( IN IFWXSocket *piInternalSocket, IN IFWXSocket *piExternalSocket, IN IFWXConnection *piConnection, IN IUnknown *punkFilterContext ) { // Using Lock/Unlock, all access to the sockets is protected // because Detach could be called at any time. Lock(); m_spInternalSocket = piInternalSocket; m_spExternalSocket = piExternalSocket; Unlock(); //ReadFirstBuffers is a function that waits for //data on both sockets. return ReadFirstBuffers(); }
The variables m_spInternalSocket and m_spExternalSocket are defined as follows:
CComPtr<IFWXSocket> m_spExternalSocket; CComPtr<IFWXSocket> m_spInternalSocket;
A filter that is emulating a connection receives NULL for the external socket interface.
Server | Requires Windows Server 2008. |
---|---|
Version | Requires Forefront Threat Management Gateway (TMG). |
Header |
Declared in Wspfwext.idl. |
Send comments about this topic to Microsoft
Build date: 11/30/2009
© 2008 Microsoft Corporation. All rights reserved.