0
点赞
收藏
分享

微信扫一扫

linphone-Tunnelconfig.java文件分析


说明

此类的主要作用主要是配置Host, port等。

功能

  1. 设置获取Host
  2. 设置获取Port
  3. 设置获取RemoteUdpMirrorPort
  4. 获取设置maximum amount of time

UML类图

linphone-Tunnelconfig.java文件分析_sed

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);
    }
}


举报

相关推荐

0 条评论