Microsoft Internet Security and Acceleration Server 2004 SDK |
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( IFWXSocket* piInternalSocket, IFWXSocket* piExternalSocket, IFWXConnection* piConnection, IUnknown* punkFilterContext );
A filter that is emulating a connection receives NULL for the external socket interface.
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;
Server: Requires Windows Server 2003 or
Windows 2000.
Version: Requires Internet Security and Acceleration
Server 2004.
Header: Declared in Wspfwext.idl.