File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
docs/framework/network-programming Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ Imports System.Text
121121Public 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
You can’t perform that action at this time.
0 commit comments