ClearConnectionNumber

Clears a logical connection from the server (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWClearConnectionNumber)

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.x, 4.x, 5.x, 6.x
Platform:NLM
Service:Server-Based Server Environment

Syntax

  #include <nlm\nit\nwenvrn.h>  
   
  int ClearConnectionNumber (  
     WORD   connectionNumber); 
  

Parameters

connectionNumber
(IN) Contains the identification number that the server assigns to a requesting workstation when the workstation attaches to the server.

Return Values

Decimal

Hex

Constant

0

(0x00)

ESUCCESS

198

(0xC6)

ERR_NO_CONSOLE_RIGHTS

Remarks

The first time a workstation attaches to a server, the server assigns it the first unused connection number in the File Server Connection Table. When a workstation detaches from a server, the server marks its connection number unused but reserves it in anticipation of reattachment. A reserved logical connection number is not reassigned to another workstation until it is the first unused connection number and the attaching workstation does not have a connection number reserved.

The server has room for 250 logical connections. The File Server Connection Table maintains the addresses of the workstations attached to the server.

This function blocks when successful.

This function closes a connection’s open files and releases a connection’s file locks. On a TTS server, this function causes a connection’s transactions to be aborted.

When a requesting workstation clears its own connection, it can no longer communicate with the server.

The requesting workstation must have security equivalence to Supervisor rights.

ClearConnectionNumber Example

  #include <stdio.h>  
  #include <nlm\nit\nwenvrn.h>  
   
  main()  
  {  
     int    ccode;  
     WORD   connectionNumber;  
     printf ("\n\n");  
     printf ("Enter connection number to be cleared:  ");  
     scanf ("%u", &connectionNumber);  
     ccode = ClearConnectionNumber (connectionNumber);  
     if (ccode == 198)  
        printf ("\n\nNO CONSOLE RIGHTS\n");  
     else if (ccode == 0)  
        printf ("\n\nSUCCESSFULLY cleared connection number. %u\n", 
                connectionNumber);  
     else  
        printf ("\nccode = %d\n", ccode);  
  }