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 R2 or Windows Server 2008 x64 Edition with SP2. |
Version | Requires Forefront Threat Management Gateway (TMG) 2010. |
Header | Declared in Wspfwext.idl. |
See Also
Send comments about this topic to Microsoft
Build date: 6/30/2010