INT SetTimeToLive( |
|
INT nTimeToLive |
|
); |
The SetTimeToLive method sets the maximum time-to-live for
the next ICMP datagram sent by the client.
Parameters
- nTimeToLive
- The time-to-live value for the next ICMP echo datagram.
Return Value
If the method succeeds, the return value is the previous
time-to-live value. If the method fails, the return value is
ICMP_ERROR. To get extended error information, call
GetLastError.
Remarks
The time-to-live (TTL) value is specified in the IP header of a
datagram, and is used to control the number of routers that the
datagram is passed through. Each router that handles the datagram
decrements the TTL value by one. When it drops to zero, a datagram is
returned to the sender, specifying that the TTL has been
exceeded.
Calling this method changes the default TTL value for all
subsequent ICMP datagrams sent by the library, with the default value
being 255. Note that not all Windows Sockets implementations support
setting the time-to-live value.
Requirements
Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: csicmv11.lib
See Also
GetPacketSize,
GetRecvCount,
GetSendCount,
GetSequenceId,
GetTimeToLive,
GetTripTime,
SetPacketSize,
SetSequenceId
|