L_InetDetachFromSocket

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

L_LTNET_API L_INT L_InetDetachFromSocket(hComputer, bWaitTillQueueEmpty, phSocket)

L_COMP hComputer;

/* handle to a computer */

L_BOOL bWaitTillQueueEmpty;

/* flag that indicates when to detach */

SOCKET * phSocket;

/* address of a variable to be filled with the socket */

Detaches the computer handle from its associated Windows socket.

Parameter

Description

hComputer

Handle to the computer that will be detached from its socket. Note that its corresponding socket is not closed. This computer handle should have been created using L_InetAttachToSocket.

bWaitTillQueueEmpty

Flag that indicates when to detach the computer handle from the socket. Possible values are:

 

Value

Meaning

 

TRUE

Detach the socket when the send queue is empty. If the send queue is empty, the computer handle is detached immediately. You will be notified of the detachment in the INETCALLBACK function when you receive the INET_DETACH message. (Recommended)

 

FALSE

Detach the handle immediately. Any data present in the queue is abandoned.

phSocket

The address of a variable to be updated with the windows socket that is being detached. This is an optional parameter and you can pass NULL if you dont need to know which socket is detached.

Returns

SUCCESS

This function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function invalidates the computer handle (there is no need to call L_InetClose for the handle).

Note that the socket is not receiving any notifications (read, write, etc). The notification events must be restored to use the socket properly. See WSAAsyncSelect in the Windows SDK help and related functions for more information on notification events.

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_InetClose, L_InetAttachToSocket, L_InetSendRawData, L_InetSendData, L_InetGetQueueSize, L_InetClearQueue

Topics:

Sending Commands and Responses

 

A Client-Server Diagram: Sending Commands and Responses

Example

For an example, refer to L_InetAttachToSocket.