Topic Path: Symbol Reference > Classes > TIdSocketHandle Class > TIdSocketHandle Methods > SetSockOpt Method
ContentsIndexHome
PreviousUpNext
TIdSocketHandle.SetSockOpt Method

Sets socket options for the socket handle in the connection.

procedure SetSockOpt(
    ALevel: TIdSocketOptionLevel; 
    AOptName: TIdSocketOption; 
    AOptVal: Integer
);
Parameters 
Description 
Level 
OptName 
Socket option to receive the option value.
 
OptVal 
Value for the requested option. 

SetSockOpt is a procedure used to set socket options for the socket handle in the connection. 

SetSockOpt calls the SetSocketOption API in GStack using the Handle for the connection, ALevel, AOptName, and AOptVal as arguments. 

Options can control socket operations such as receiving Out-Of-Band data, broadcasting datagram packets, and much more. 

There are two types of socket options: Boolean and Data. Boolean options enable or disable a specific feature. Use a zero value in OptVal to disable a feature, and a non-zero value in OptVal to enable the feature. 

Data options require the address used to store the value or structure in OptVal. 

OptNames use the constant values that include: 

 

Option Name 
Type 
Usage 
Boolean 
Allow transmission of broadcast messages on the socket. 
Boolean 
Record debugging information. 
Id_SO_DONTLINGER 
Boolean 
Don't block CloseSocket for unsent data. 
Boolean 
Don't route dsata, send it directly to the interface. 
Boolean 
Send keepalive packets. 
Data 
Linger on close if unsent data is present. 
Boolean 
Receive out-of-band data in the normal data stream. 
Data 
Integer buffer size for receives. 
Boolean 
Allow the socket to be bound to an address which is already in use. 
Data 
Integer buffer size for sends. 
Data 
Integer Receive timeout. 
Data 
Integer Send timeout. 
Id_IP_TTL 
Data 
Integer Time-To-Live for IP header fields. 
Boolean 
Disables Nagle algorithm for send coalescing. 
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.