本文整理汇总了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);
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);