Share via


IFWXSession::CreateNetworkSocket method

Applies to: desktop apps only

The CreateNetworkSocket method creates a TCP/IP socket that is associated with the session.

Syntax

HRESULT CreateNetworkSocket(
  [in]   INT Protocol,
  [out]  IFWXNetworkSocket **piSocket
);

Parameters

  • Protocol [in]
    Protocol flags. This parameter can have the following flag values:

    Value Meaning
    FWX_PROTOCOL_TCP

    The method will create a TCP socket.

    FWX_PROTOCOL_UDP

    The method will create a UDP socket.

     

  • piSocket [out]
    Address of a variable that receives a pointer to the new IFWXNetworkSocket interface created.

Return value

This method can return one of these values.

  • S_OK
    The socket was created.

  • E_OUTOFMEMORY
    Not enough memory or resources could be allocated to process the event. The socket was not created.

  • HRESULT_FROM_WIN32(Win32 error code)
    Winsock or Windows error code. The method failed, and the socket was not created.

Remarks

The socket created by this method is user-specific, and obeys the policy rules for the session. Connections are logged as if they were performed by the session's user.

To create a socket that is not user-specific, use IFWXFirewall::CreateNetworkSocket.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only)

Version

Forefront Threat Management Gateway (TMG) 2010

Header

Wspfwext.idl

DLL

Wspsrv.exe

See also

IFWXSession

IFWXFirewall::CreateNetworkSocket

 

 

Build date: 7/12/2010