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
121
121
Public Class Program
122
122
Public Shared Sub Main(args() As [String])
123
123
Dim s As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
124
+ s.EnableBroadcast = True
124
125
Dim broadcast As IPAddress = IPAddress.Parse( "192.168.1.255" )
125
126
Dim sendbuf As Byte () = Encoding.ASCII.GetBytes(args( 0 ))
126
127
Dim ep As New IPEndPoint(broadcast, 11000 )
@@ -141,6 +142,7 @@ class Program
141
142
static void Main (string [] args )
142
143
{
143
144
Socket s = new Socket (AddressFamily .InterNetwork , SocketType .Dgram , ProtocolType .Udp );
145
+ s .EnableBroadcast = true ;
144
146
145
147
IPAddress broadcast = IPAddress .Parse (" 192.168.1.255" );
146
148
You can’t perform that action at this time.
0 commit comments