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

◆ SetMulticastOption()

static SocketError System.Net.Sockets.SocketPal.SetMulticastOption ( SafeSocketHandle handle,
SocketOptionName optionName,
MulticastOption optionValue )
inlinestatic

Definition at line 527 of file SocketPal.cs.

528 {
529 global::Interop.Winsock.IPMulticastRequest mreq = default(global::Interop.Winsock.IPMulticastRequest);
530 mreq.MulticastAddress = (int)optionValue.Group.Address;
531 if (optionValue.LocalAddress != null)
532 {
533 mreq.InterfaceAddress = (int)optionValue.LocalAddress.Address;
534 }
535 else
536 {
537 int interfaceAddress = IPAddress.HostToNetworkOrder(optionValue.InterfaceIndex);
538 mreq.InterfaceAddress = interfaceAddress;
539 }
540 SocketError socketError = global::Interop.Winsock.setsockopt(handle, SocketOptionLevel.IP, optionName, ref mreq, global::Interop.Winsock.IPMulticastRequest.Size);
541 if (socketError != SocketError.SocketError)
542 {
543 return SocketError.Success;
544 }
545 return GetLastSocketError();
546 }
static SocketError GetLastSocketError()
Definition SocketPal.cs:22

References System.Net.Sockets.SocketPal.GetLastSocketError(), System.handle, and System.Net.IPAddress.HostToNetworkOrder().

Referenced by System.Net.Sockets.Socket.SetMulticastOption().