Search in sources :

Example 1 with TimeoutConfig

use of com.fanap.podchat.networking.retrofithelper.TimeoutConfig in project pod-chat-android-sdk by FanapSoft.

the class ChatPresenter method connect.

@Override
public void connect(RequestConnect requestConnect) {
    NetworkPingSender.NetworkStateConfig build = new NetworkPingSender.NetworkStateConfig().setHostName("msg.pod.ir").setPort(443).setDisConnectionThreshold(2).setInterval(7000).setConnectTimeout(10000).build();
    // TimeoutConfig uploadConfig = new TimeoutConfig()
    // .newConfigBuilder()
    // .withConnectTimeout(120, TimeUnit.MINUTES)
    // .withWriteTimeout(120, TimeUnit.MINUTES)
    // .withReadTimeout(120, TimeUnit.MINUTES)
    // .build();
    TimeoutConfig downloadConfig = new TimeoutConfig().newConfigBuilder().withConnectTimeout(20, TimeUnit.SECONDS).withWriteTimeout(0, TimeUnit.SECONDS).withReadTimeout(5, TimeUnit.MINUTES).build();
    chat.setNetworkStateConfig(build);
    // 
    // chat.setUploadConfig(uploadConfig);
    // 
    // chat.setDownloadConfig(downloadConfig);
    chat.connect(requestConnect);
}
Also used : TimeoutConfig(com.fanap.podchat.networking.retrofithelper.TimeoutConfig) NetworkPingSender(com.fanap.podchat.util.NetworkUtils.NetworkPingSender)

Example 2 with TimeoutConfig

use of com.fanap.podchat.networking.retrofithelper.TimeoutConfig in project pod-chat-android-sdk by FanapSoft.

the class CallPresenter method connect.

public void connect(RequestConnect requestConnect) {
    NetworkPingSender.NetworkStateConfig build = new NetworkPingSender.NetworkStateConfig().setHostName("msg.pod.ir").setPort(443).setDisConnectionThreshold(2).setInterval(7000).setConnectTimeout(10000).build();
    // TimeoutConfig uploadConfig = new TimeoutConfig()
    // .newConfigBuilder()
    // .withConnectTimeout(120, TimeUnit.MINUTES)
    // .withWriteTimeout(120, TimeUnit.MINUTES)
    // .withReadTimeout(120, TimeUnit.MINUTES)
    // .build();
    TimeoutConfig downloadConfig = new TimeoutConfig().newConfigBuilder().withConnectTimeout(20, TimeUnit.SECONDS).withWriteTimeout(0, TimeUnit.SECONDS).withReadTimeout(5, TimeUnit.MINUTES).build();
    chat.setNetworkStateConfig(build);
    // 
    // chat.setUploadConfig(uploadConfig);
    // 
    // chat.setDownloadConfig(downloadConfig);
    chat.connect(requestConnect);
}
Also used : TimeoutConfig(com.fanap.podchat.networking.retrofithelper.TimeoutConfig) NetworkPingSender(com.fanap.podchat.util.NetworkUtils.NetworkPingSender)

Aggregations

TimeoutConfig (com.fanap.podchat.networking.retrofithelper.TimeoutConfig)2 NetworkPingSender (com.fanap.podchat.util.NetworkUtils.NetworkPingSender)2