说明
此类的主要作用主要是配置Host, port等。
功能
- 设置获取Host
- 设置获取Port
- 设置获取RemoteUdpMirrorPort
- 获取设置maximum amount of time
UML类图
TunnelConfig.java
package org.linphone.core;
public class TunnelConfigImpl implements TunnelConfig{
long mNativePtr;
protected TunnelConfigImpl(long nativePtr){
mNativePtr = nativePtr;
}
// Get the hostname of the tunnel server
private native String getHost(long nativePtr);
@Override
public String getHost() {
return getHost(mNativePtr);
}
//Set the hostname (or iiip address) of the tunnel server.
private native void setHost(long nativePtr, String host);
@Override
public void setHost(String host) {
setHost(mNativePtr, host);
}
// Get the port where to connect.
private native int getPort(long nativePtr);
@Override
public int getPort() {
return getPort(mNativePtr);
}
// Set the port where to connect to teh tunnel server.
// When not set, the default value is used (443).
private native void setPort(long nativePtr, int port);
@Override
public void setPort(int port) {
setPort(mNativePtr, port);
}
// Get the remote udp mirror port, which is used to check udp connectivity of the network
private native int getRemoteUdpMirrorPort(long nativePtr);
@Override
public int getRemoteUdpMirrorPort() {
return getRemoteUdpMirrorPort(mNativePtr);
}
// Set the udp mirror port, which is used to check udp connectivity
private native void setRemoteUdpMirrorPort(long nativePtr, int remoteUdpMirrorPort);
@Override
public void setRemoteUdpMirrorPort(int remoteUdpMirrorPort) {
setRemoteUdpMirrorPort(mNativePtr, remoteUdpMirrorPort);
}
// Get the maximum amount of time for waiting for UDP packets to come back during the UDP connectivity check, in milliseconds.
private native int getDelay(long nativePtr);
@Override
public int getDelay() {
return getDelay(mNativePtr);
}
// Set the maximum amount of time for waiting for UDP packets to come back during the UDP connectivity check, in milliseconds.
private native void setDelay(long nativePtr, int delay);
@Override
public void setDelay(int delay) {
setDelay(mNativePtr, delay);
}
private native void enableSip(long nativePtr, boolean enabled);
private native void destroy(long nativePtr);
protected void finalize() throws Throwable {
if (mNativePtr!=0) destroy(mNativePtr);
}
}