Internet Direct (Indy)
Home
PreviousUpNext
TIdSocketHandle.CloseSocket Method

Closes the connection and destroys the socket handle.

Pascal
procedure CloseSocket; virtual;

CloseSocket is a virtual procedure used to close the socket connection, and to reset the handle for the socket descriptor. 

When HandleAllocated indicates the socket handle is valid, CloseSocket will reset both the Handle and the HandleAllocated flag by calling Disconnect on the global protocol stack. CloseSocket also sets Handle to Id_INVALID_SOCKET to prevent subsequent access using the now invalid socket descriptor. Access to the socket handle and the allocated flag in the method is a thread-safe operation; they are protected using an internal TIdCriticalSection instance. 

TIdSocketHandle.HandleAllocated, TIdSocketHandle.Handle, GStack, TIdCriticalSection, Id_INVALID_SOCKET 

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.