Microsoft Internet Security and Acceleration Server 2004 SDK

IFWXConnection::EmulateConnection

The EmulateConnection method creates a connection to a client for a filter-emulated listening (inbound) connection.

HRESULT EmulateConnection(
  IFWXDataFilter* piDataFilter,
  LPSOCKADDR RemoteAddress,
  DWORD RemoteAddressLength,
  LPSOCKADDR LocalAddress,
  DWORD LocalAddressLength,
  IFWXConnection** ppNewIFWXConnection
);

Parameters

piDataFilter
[in] 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.
RemoteAddress
[in] 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.
RemoteAddressLength
[in] Length, in bytes, of the RemoteAddress parameter.
LocalAddress
[in] 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.
LocalAddressLength
[in] Length, in bytes, of the LocalAddress parameter.
ppNewIFWXConnection
[out] 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.

Return Values

S_OK
The method succeeded.
HRESULT_FROM_WIN32(WSAEINVAL)
The connection object is not in a listening state or is not being emulated.
HRESULT_FROM_WIN32
The method failed and returned a Windows Sockets (Winsock) error code.
E_OUTOFMEMORY
Insufficient memory or resources; the method failed.
FWX_E_TERMINATING
The object is shutting down.

Remarks

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.

Requirements

Server: Requires Windows Server 2003 or Windows 2000.
Version: Requires Internet Security and Acceleration Server 2004.
Header: Declared in Wspfwext.idl.

See Also

IFWXConnection, EmulateForBind