Skip to content

Commit e6f0207

Browse files
Update using-udp-services.md (#43738)
1 parent 4a38d79 commit e6f0207

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/framework/network-programming/using-udp-services.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Imports System.Text
121121
Public Class Program
122122
Public Shared Sub Main(args() As [String])
123123
Dim s As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
124+
s.EnableBroadcast = True
124125
Dim broadcast As IPAddress = IPAddress.Parse("192.168.1.255")
125126
Dim sendbuf As Byte() = Encoding.ASCII.GetBytes(args(0))
126127
Dim ep As New IPEndPoint(broadcast, 11000)
@@ -141,6 +142,7 @@ class Program
141142
static void Main(string[] args)
142143
{
143144
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
145+
s.EnableBroadcast = true;
144146

145147
IPAddress broadcast = IPAddress.Parse("192.168.1.255");
146148

0 commit comments

Comments
 (0)