Created
June 17, 2018 19:41
-
-
Save aquiladev/50605febb0037aee0b4439eca9530829 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); | |
IPAddress broadcast = IPAddress.Parse("192.168.1.102"); | |
byte[] sendbuf = Encoding.ASCII.GetBytes("{11111111111}"); | |
IPEndPoint ep = new IPEndPoint(broadcast, 1700); | |
Console.WriteLine(sendbuf.Length); | |
s.SendTo(sendbuf, ep); | |
Console.WriteLine("Message sent to the broadcast address"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment