The EmulateConnection method creates a connection to a client for a filter-emulated listening (inbound) connection.
HRESULT EmulateConnection( [in] IFWXDataFilter* piDataFilter, [in] LPSOCKADDR RemoteAddress, [in] DWORD RemoteAddressLength, [in] LPSOCKADDR LocalAddress, [in] DWORD LocalAddressLength, [out] IFWXConnection** ppNewIFWXConnection );
Pointer to the IFWXDataFilter interface on the data filter that supplies the data for the connection. The data filter is installed with fwx_dfpc_Emulation priority, which is closest to the Internet. The data filter only receives an interface of an internal socket. An external socket is assumed to be held by the caller.
Pointer to a sockaddr structure that contains the address of the remote socket that is connecting to the client. This address is set in the output parameter of the accept and getpeername functions on the client.
Length, in bytes, of the RemoteAddress parameter.
Pointer to a sockaddr structure that contains the local Microsoft Firewall service address that is used for the connection. This is the address that the getsockname function returns to the client.
Length, in bytes, of the LocalAddress parameter.
Pointer to a variable that receives an IFWXConnection interface pointer on the connection object that is created for this new connection. The parameter can be NULL. The reference to the new connection object must not be held after an event of type fwx_ConnectionTerminating for that connection is received.
The method succeeded.
The connection object is not in a listening state or is not being emulated.
The method failed and returned a Windows Sockets (Winsock) error code.
Not enough memory or resources could be allocated to complete the operation.
The object is shutting down.
This method may be called only if this connection is in the listening state, and the caller is a filter that is emulating the listening state for the connection. Clients use the emulated connection, so that, effectively, only one real connection is used.
Server | Requires Windows Server 2008. |
---|---|
Version | Requires Forefront Threat Management Gateway (TMG). |
Header |
Declared in Wspfwext.idl. |
DLL |
Requires Wspsrv.exe. |
Send comments about this topic to Microsoft
Build date: 11/30/2009
© 2008 Microsoft Corporation. All rights reserved.