DisableConnection

Temporarily prevents the server from servicing any requests (except requests made by the calling NLM) for the specified connection number

Local Servers:nonblocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Connection Number and Task Management

Syntax

  #include <nwcntask.h>  
   
  int DisableConnection  (  
     LONG   connection); 
  

Parameters

connection
(IN) Specifies the connection number to disable.

Return Values

The following table lists return values and descriptions.

Value

Hex

Name

Description

0

(0x00)

ESUCCESS

Connection was disabled.

-1

 

EFAILURE

Connection is in use or already disabled.

Remarks

The DisableConnection function reserves the specified connection number solely for the use of the NLM. It prevents both the workstation and other NLM applications from using the connection number. However, other NLM applications must cooperate by also calling this function.

While the connection is temporarily disabled, the NLM can perform file service functions without any conflict from the workstation or other NLM applications. Disable a connection number for only a short period.

Once the NLM has used the specified connection number, the NLM should call EnableConnection, allowing the server to again service requests for the specified connection number.

An NLM should check the completion code of this function to make sure another NLM does not already have the connection disabled, or is otherwise in an incompatible state (such as disconnecting or processing an NCP request).

See Also

CheckIfConnectionActive,