CompleteAsyncAccept Method of the IFWXAcceptCompletion Interface

The CompleteAsyncAccept method receives a notification that the work performed in a call to the IFWXNetworkSocket::Accept method is completed (that a client connected to the listening socket).

Syntax

HRESULT CompleteAsyncAccept(
  [in]  BOOL fSuccess,
  [in]  DWORD Win32ErrorCode,
  [in]  IFWXNetworkSocket* pListeningSocket,
  [in]  IFWXNetworkSocket* pAcceptSocket,
  [in]  LPSOCKADDR RemoteAddress,
  [in]  DWORD RemoteAddressLength,
  [in]  LPSOCKADDR LocalAddress,
  [in]  DWORD LocalAddressLength,
  [in]  UserContextType UserData
);

Parameters

fSuccess

Success flag. If TRUE, the IFWXNetworkSocket::Accept method succeeded. If FALSE, the method failed.

Win32ErrorCode

Windows error code. This parameter is defined only if the fSuccess parameter is set to FALSE.

pListeningSocket

Pointer to the IFWXNetworkSocket interface on the listening socket.

pAcceptSocket

Pointer to the IFWXNetworkSocket interface on the newly accepted connection.

RemoteAddress

Pointer to a sockaddr structure that contains the remote address of the connection. This is the same information that would be returned by the Windows Sockets (Winsock) getpeername function.

RemoteAddressLength

Size, in bytes, of the buffer pointed to by the RemoteAddress parameter.

LocalAddress

Pointer to a sockaddr structure that contains the local address of the connection. This is the same information that would be returned by the Winsock getsockname function.

LocalAddressLength

Size, in bytes, of the buffer to which the LocalAddress parameter points.

UserData

The UserData parameter that was supplied to the IFWXNetworkSocket::Accept method.

Return Value

Implementations of this method should handle any run-time error and return S_OK. By itself the return value has no effect on the Firewall’s operation. Whether the Accept Operation completed successfully or not (indicated by the fSuccess parameter), it is legal for the implementation to issue another Accept() request or close the listening socket.

Remarks

The UserData parameter provides a context to the notification. You can use the same notification interface for receiving completion notifications from different network socket objects and differentiate among them by using different values for UserData.

Requirements

Server Requires Windows Server 2008.
Version Requires Forefront Threat Management Gateway (TMG).
Header

Declared in Wspfwext.idl.

See Also

IFWXAcceptCompletion


Send comments about this topic to Microsoft

Build date: 11/30/2009

© 2008 Microsoft Corporation. All rights reserved.