当前位置: 首页>>代码示例>>Java>>正文


Java NatMapEntry类代码示例

本文整理汇总了Java中io.evercam.network.discovery.NatMapEntry的典型用法代码示例。如果您正苦于以下问题:Java NatMapEntry类的具体用法?Java NatMapEntry怎么用?Java NatMapEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NatMapEntry类属于io.evercam.network.discovery包,在下文中一共展示了NatMapEntry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test

import io.evercam.network.discovery.NatMapEntry; //导入依赖的package包/类
@Test
   public void test() throws Exception {
GatewayDevice gatewayDevice = new GatewayDevice(TEST_ROUTER_IP);
assertFalse(gatewayDevice.isRouter());
assertFalse(gatewayDevice.isUPnPAvaliable());

ArrayList<NatMapEntry> mapEntries = gatewayDevice.getNatTableArray();
if (mapEntries.size() != 0) {
    for (NatMapEntry mapEntry : mapEntries) {
	String natIP = mapEntry.getIpAddress();
	int natInternalPort = mapEntry.getInternalPort();
	int natExternalPort = mapEntry.getExternalPort();
	System.out.println(natIP + " " + natInternalPort + " "
		+ natExternalPort);
    }
}
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:18,代码来源:GatewayDeviceTest.java

示例2: run

import io.evercam.network.discovery.NatMapEntry; //导入依赖的package包/类
@Override
public void run()
{
    try
    {
        GatewayDevice gatewayDevice = new GatewayDevice(routerIp);
        ArrayList<NatMapEntry> mapEntries = gatewayDevice.getNatTableArray(); //NAT Table

        if(mapEntries.size() > 0)
        {
            for(NatMapEntry mapEntry : mapEntries)
            {
                String natIp = mapEntry.getIpAddress();

                for(DiscoveredCamera discoveredCamera : cameraList)
                {
                    if(discoveredCamera.getIP().equals(natIp))
                    {
                        DiscoveredCamera publishCamera = EvercamDiscover.mergeNatEntryToCameraIfMatches(discoveredCamera, mapEntry);

                        publishProgress(publishCamera);

                        break; //break the inner loop
                    }
                }
            }
        }
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
    natDone = true;
    scanPercentage += PER__DISCOVERY_METHOD_PERCENT;
    updatePercentageOnActivity(scanPercentage);
}
 
开发者ID:GNUDimarik,项目名称:evercam-play-android2,代码行数:37,代码来源:ScanForCameraTask.java

示例3: mergeNatEntryToCamera

import io.evercam.network.discovery.NatMapEntry; //导入依赖的package包/类
public static DiscoveredCamera mergeNatEntryToCamera(
    DiscoveredCamera camera, NatMapEntry mapEntry) {
int natInternalPort = mapEntry.getInternalPort();
int natExternalPort = mapEntry.getExternalPort();

if (camera.getHttp() == natInternalPort) {
    camera.setExthttp(natExternalPort);
}
if (camera.getRtsp() == natInternalPort) {
    camera.setExtrtsp(natExternalPort);
}

return camera;
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:15,代码来源:EvercamDiscover.java

示例4: mergeNatTableToCamera

import io.evercam.network.discovery.NatMapEntry; //导入依赖的package包/类
public static DiscoveredCamera mergeNatTableToCamera(
    DiscoveredCamera camera, ArrayList<NatMapEntry> mapEntries) {
if (mapEntries != null && mapEntries.size() > 0) {
    for (NatMapEntry mapEntry : mapEntries) {
	String natIp = mapEntry.getIpAddress();
	if (camera.getIP().equals(natIp)) {
	    mergeNatEntryToCamera(camera, mapEntry);
	}
    }
}
return camera;
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:13,代码来源:EvercamDiscover.java

示例5: onFinished

import io.evercam.network.discovery.NatMapEntry; //导入依赖的package包/类
/**
 * Callback for NAT discovery results
 * 
 * Check if mapEntries is null before invoking it
 * 
 * @param mapEntries
 *            the discovered NAT table
 */
public abstract void onFinished(ArrayList<NatMapEntry> mapEntries);
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:10,代码来源:NatRunnable.java


注:本文中的io.evercam.network.discovery.NatMapEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。