标签归档:upd

C# UDP组播

//组播代码

using System;

using System.Collections.Generic;

using System.Linq;using System.Text;

using System.Net;using System.Net.Sockets;

using System.Threading;

namespaceTest {

classProgram     {
        staticvoidMain(string[] args)
        {
            UdpClient client = new UdpClient(5566);
            client.JoinMulticastGroup(IPAddress.Parse("234.5.6.7"));
            IPEndPoint multicast = new IPEndPoint(IPAddress.Parse("234.5.6.7"), 7788);
            byte[] buf = Encoding.Default.GetBytes("Hello from multicast");
            Thread t = new Thread(new ThreadStart(RecvThread));
   ...

继续阅读

发表在 network | 标签为 , | C# UDP组播已关闭评论