L_InetClose

#include "l_bitmap.h"
#include "ltnet.h"

L_LTNET_API L_INT L_InetClose(hComputer, bGraceful)

L_COMP hComputer;

/* handle of computer */

L_BOOL bGraceful;

/* disconnect flag */

Closes either a server setup or a connection with a remote computer.

Parameter

Description

hComputer

Handle of the computer for which connection is to be closed

bGraceful

Flag that determines when the connection is closed. Possible values are:

 

Value

Meaning

 

TRUE

allow all data to be sent before connection is closed.

 

FALSE

close the connection now.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

If bGraceful is TRUE, then the connection will be closed after all the data has been sent. If you have sent a large chunk of data immediately before calling L_InetClose, then there is a high probability that not every byte has been sent. Closing with bGraceful = FALSE means that the connection is closed without delay, and with the possibility that the data you sent will be truncated. Closing with bGraceful = TRUE means that the close will be delayed until all the data has been sent. You will be notified of the disconnection in the INETCALLBACK function when you receive the INET_CLOSE message.

You must initialize the LEADTOOLS Internet DLL using L_InetStartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_InetConnect, L_InetServerInit, L_InetSendData, INETCALLBACK, L_InetStartUp, L_InetShutDown

Topics:

Internet Functions

Example

For an example, refer to L_InetConnect.