2017-02-12 18 views
0

java telegram apiを使用してテレグラムに接続しようとしています。このコードには、それは例外テレグラムのdcへの接続java

private static void createApi() throws IOException { 
    apiState = new ApiStorage(true); 
    api = new TelegramApi(apiState, new AppInfo(API_ID, "console", "2", "1", "en"), new ApiCallback() { 

     @Override 
     public void onAuthCancelled(TelegramApi api) { 

     } 

     @Override 
     public void onUpdatesInvalidated(TelegramApi api) { 

     } 

     @Override 
     public void onUpdate(TLAbsUpdates updates) { 
     } 
    }); 
} 

をスローし、それは私がコンソールに表示するものです。

TelegramApi#1001:Phase 0 in 1 ms 
TelegramApi#1001:Phase 1 in 119 ms 
TelegramApi#1001:Timeout Iteration 
TelegramApi#1001:Connection iteration 
TelegramApi#1001:#1: waitForDc 
TelegramApi#1001:#1: Creating proto for dc 
TelegramApi#1001:#1: Creating key 
TelegramApi#1001:Phase 2 in 7 ms 
TelegramApi#1001:Sender iteration 
TelegramApi#1001:Phase 3 in 7 ms 
api#1001#Uploader:UploadFileThread iteration 
api#1001#Uploader:UploadFileThread iteration 
api#1001#Uploader:UploadFileThread iteration 
api#1001#Downloader:DownloadFileThread iteration 
api#1001#Downloader:DownloadFileThread iteration 
api#1001#Downloader:DownloadFileThread iteration 
api#1001#Uploader:UploadFileThread iteration 
api#1001#Downloader:DownloadFileThread iteration 
TransportRate:Transport: #1 149.154.167.40:443 #1.0 
TransportRate:tryConnection #1 
java.net.BindException: Cannot assign requested address: connect 

私は私が間違ってやっている見当がつかない。

答えて

0

このエラーは、指定されたアドレス(149.154.167.40:443)に接続できないことを意味します。おそらく、あなたの現在の場所から間違っている、時代遅れの、または不便です。

一部DATATセンター(DC)アドレス: https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/config.h#L212

はあまりにもこれらのメソッドに見てみましょう:help.getConfighelp.getNearestDcを。