📄 listenerthread.java
字号:
package bingo.shared;import java.net.*;import java.io.*;public abstract class ListenerThread extends Thread { boolean stopListening = false; MulticastSocket socket; private InetAddress group; private String groupString; public ListenerThread(String groupString) throws UnknownHostException, IOException { super(); this.groupString = groupString; this.group = InetAddress.getByName(groupString); socket = new MulticastSocket(Constants.portNumber); socket.joinGroup(group); } public void stopListening() throws IOException{ stopListening = true; socket.leaveGroup(group); socket.close(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -