⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e154. receiving from a multicast group.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
Once you've created a multicast socket and joined the group, all datagrams sent to its corresponding multicast address will be available to be read from the socket. You can read from the socket just like you would from a unicast socket. 
    public void read(MulticastSocket msocket, byte[] inbuf) {
        try {
            DatagramPacket packet = new DatagramPacket(inbuf, inbuf.length);
    
            // Wait for packet
            msocket.receive(packet);
    
            // Data is now in inbuf
            int numBytesReceived = packet.getLength();
        } catch (IOException e) {
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -