amylizxy/udpMulticast

电脑做服务端,手机做客户端时无法找到

realicing opened this issue · 1 comments

电脑上代码:
public class Server {
private static final byte DEVICE_TYPE_NAME_21 = 0x21;
private static final byte DEVICE_TYPE_ROOM_22 = 0x22;

public static void init() {
    ServerConfig.setFunc(1);
    DeviceData deviceData = new DeviceData();
    deviceData.setDevId("aaa111");
    deviceData.setFunc(1);
    deviceData.setServiceName("aa");
    deviceData.setPkgName("com.udp.device");
    ServerConfig.setDeviceData(deviceData);
    SearchServer server = new SearchServer(1024) {

        @Override
        public void printLog(String log) {
            System.out.println("server " + log);
        }

        @Override
        public void onReceiveSearchReq(RequestSearchData data) {
            System.out.println("server onReceiveSearchReq");
        }
    };
    server.init();
}

public static void main(String[] args) {
    init();
}

}
手机上没有做修改

另外,手机和电脑不在一个网段