Lue englanniksi

Jaa


TcSetSocketFlow function

The TcSetSocketFlow function enables a flow on a socket. The socket will use that flow's parameters until a new flow is set on the socket, or the flow is deleted.

Syntax

c++
ULONG TcSetSocketFlow(
  _In_ HANDLE SocketHandle,
  _In_ HANDLE FlowHandle
);

Parameters

  • SocketHandle [in]
    Handle to the socket that will use the flow. A SOCKET may be cast to a HANDLE for this parameter.

  • FlowHandle [in]
    A flow handle, as created by TcAddFlow.

Return value

The TcSetSocketFlow function has the following return values.

Return code Description
NO_ERROR

The function executed without errors.

ERROR_INVALID_HANDLE

FlowHandle is not a valid flow handle.

ERROR_NOT_ENOUGH_MEMORY

Not enough memory to complete the operation.

ERROR_INVALID_PARAMETER

Invalid parameter; SocketHandle is not a valid socket handle or FlowHandle is not a valid flow handle

ERROR_NOT_READY

The flow handle is not in the correct state.

 

Remarks

After creating a flow handle for an interface, use TcSetSocketFlow to associate the flow with a particular socket. The socket will then use the flow parameters specified when the flow was created. The socket used in TcSetSocketFlow must belong to the same network interface as the flow.

After the flow is no longer needed on the socket, call TcSetSocketFlow with NULL as the FlowHandle.

Note  Use of the TcSetSocketFlow function requires administrative privilege.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Traffic.h

DLL

Traffic.dll