Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Ttl

short System.Net.Sockets.Socket.Ttl
getset

Definition at line 877 of file Socket.cs.

878 {
879 get
880 {
881 if (_addressFamily == AddressFamily.InterNetwork)
882 {
883 return (short)(int)GetSocketOption(SocketOptionLevel.IP, SocketOptionName.ReuseAddress);
884 }
885 if (_addressFamily == AddressFamily.InterNetworkV6)
886 {
887 return (short)(int)GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.ReuseAddress);
888 }
889 throw new NotSupportedException(System.SR.net_invalidversion);
890 }
891 set
892 {
893 if (value < 0 || value > 255)
894 {
895 throw new ArgumentOutOfRangeException("value");
896 }
897 if (_addressFamily == AddressFamily.InterNetwork)
898 {
900 return;
901 }
902 if (_addressFamily == AddressFamily.InterNetworkV6)
903 {
905 return;
906 }
907 throw new NotSupportedException(System.SR.net_invalidversion);
908 }
909 }
AddressFamily _addressFamily
Definition Socket.cs:555
object? GetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName)
Definition Socket.cs:2235
void SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue)
Definition Socket.cs:2143
static string net_invalidversion
Definition SR.cs:16
Definition SR.cs:7