Java Code Examples for org.telegram.tgnet.TLRPC#TL_phoneConnection

The following examples show how to use org.telegram.tgnet.TLRPC#TL_phoneConnection . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VoIPController.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void setRemoteEndpoints(TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer){
	if(endpoints.length==0){
		throw new IllegalArgumentException("endpoints size is 0");
	}
	for(int a=0; a<endpoints.length; a++){
		TLRPC.TL_phoneConnection endpoint=endpoints[a];
		if(endpoint.ip==null || endpoint.ip.length()==0){
			throw new IllegalArgumentException("endpoint "+endpoint+" has empty/null ipv4");
		}
		if(endpoint.peer_tag!=null && endpoint.peer_tag.length!=16){
			throw new IllegalArgumentException("endpoint "+endpoint+" has peer_tag of wrong length");
		}
	}
	ensureNativeInstance();
	nativeSetRemoteEndpoints(nativeInst, endpoints, allowP2p, tcp, connectionMaxLayer);
}
 
Example 2
Source File: VoIPController.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void setRemoteEndpoints(TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer){
	if(endpoints.length==0){
		throw new IllegalArgumentException("endpoints size is 0");
	}
	for(int a=0; a<endpoints.length; a++){
		TLRPC.TL_phoneConnection endpoint=endpoints[a];
		if(endpoint.ip==null || endpoint.ip.length()==0){
			throw new IllegalArgumentException("endpoint "+endpoint+" has empty/null ipv4");
		}
		if(endpoint.peer_tag!=null && endpoint.peer_tag.length!=16){
			throw new IllegalArgumentException("endpoint "+endpoint+" has peer_tag of wrong length");
		}
	}
	ensureNativeInstance();
	nativeSetRemoteEndpoints(nativeInst, endpoints, allowP2p, tcp, connectionMaxLayer);
}
 
Example 3
Source File: VoIPController.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
public void setRemoteEndpoints(TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer){
	if(endpoints.length==0){
		throw new IllegalArgumentException("endpoints size is 0");
	}
	for(int a=0; a<endpoints.length; a++){
		TLRPC.TL_phoneConnection endpoint=endpoints[a];
		if(endpoint.ip==null || endpoint.ip.length()==0){
			throw new IllegalArgumentException("endpoint "+endpoint+" has empty/null ipv4");
		}
		if(endpoint.peer_tag!=null && endpoint.peer_tag.length!=16){
			throw new IllegalArgumentException("endpoint "+endpoint+" has peer_tag of wrong length");
		}
	}
	ensureNativeInstance();
	nativeSetRemoteEndpoints(nativeInst, endpoints, allowP2p, tcp, connectionMaxLayer);
}
 
Example 4
Source File: VoIPController.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
public void setRemoteEndpoints(TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer){
	if(endpoints.length==0){
		throw new IllegalArgumentException("endpoints size is 0");
	}
	for(int a=0; a<endpoints.length; a++){
		TLRPC.TL_phoneConnection endpoint=endpoints[a];
		if(endpoint.ip==null || endpoint.ip.length()==0){
			throw new IllegalArgumentException("endpoint "+endpoint+" has empty/null ipv4");
		}
		if(endpoint.peer_tag!=null && endpoint.peer_tag.length!=16){
			throw new IllegalArgumentException("endpoint "+endpoint+" has peer_tag of wrong length");
		}
	}
	ensureNativeInstance();
	nativeSetRemoteEndpoints(nativeInst, endpoints, allowP2p, tcp, connectionMaxLayer);
}
 
Example 5
Source File: VoIPController.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
private native void nativeSetRemoteEndpoints(long inst, TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer); 
Example 6
Source File: VoIPController.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
private native void nativeSetRemoteEndpoints(long inst, TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer); 
Example 7
Source File: VoIPController.java    From Telegram-FOSS with GNU General Public License v2.0 votes vote down vote up
private native void nativeSetRemoteEndpoints(long inst, TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer); 
Example 8
Source File: VoIPController.java    From Telegram with GNU General Public License v2.0 votes vote down vote up
private native void nativeSetRemoteEndpoints(long inst, TLRPC.TL_phoneConnection[] endpoints, boolean allowP2p, boolean tcp, int connectionMaxLayer);