title: Telegram Java API- socket connection issue
body: <p>I'm trying to use Telegram Java API <a href="https://github.com/ardock/telegram-api" rel="nofollow">https://github.com/ardock/telegram-api</a>
  and I started with some simple RPC call:</p>
  
  <pre><code>SampleApiState apiState = new SampleApiState(connections);
  TLRequestAuthCheckPhone checkRequest = new TLRequestAuthCheckPhone("+1234567890");
  TelegramApi api = new TelegramApi(apiState, new ApplicationInfo(),
              new ApiCallback() {
                  @Override
                  public void onUpdatesInvalidated(TelegramApi api) {
                      // TODO Auto-generated method stub
                      Log.i(TAG, "onUpdatesInvalidated");
                  }
  
                  @Override
                  public void onAuthCancelled(TelegramApi api) {
                      // TODO Auto-generated method stub
                      Log.i(TAG, "onAuthCancelled");
                  }
  
                  @Override
                  public void onUpdate(TLAbsUpdates updates) {
                      // TODO Auto-generated method stub
                      Log.i(TAG, "onUpdate");
                  }
              });
      TLCheckedPhone checkedPhone = api.doRpcCall(checkRequest);
  </code></pre>
  
  <p>And here is log: </p>
  
  <pre><code>11524-11580/com.example.tltest W/System.err﹕ java.net.SocketException: socket failed: EACCES (Permission denied)
  11524-11580/com.example.tltest W/System.err﹕ at libcore.io.IoBridge.socket(IoBridge.java:576)
  11524-11580/com.example.tltest W/System.err﹕ at        java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)
  11524-11580/com.example.tltest W/System.err﹕ at java.net.Socket.checkOpenAndCreate(Socket.java:664)
  11524-11580/com.example.tltest W/System.err﹕ at java.net.Socket.connect(Socket.java:808)
  11524-11580/com.example.tltest W/System.err﹕ at org.telegram.mtproto.transport.PlainTcpConnection.&lt;init&gt;(PlainTcpConnection.java:32)
  11524-11580/com.example.tltest W/System.err﹕ at org.telegram.mtproto.pq.Authorizer.doAuth(Authorizer.java:198)
  11524-11580/com.example.tltest W/System.err﹕ at org.telegram.api.engine.TelegramApi$ConnectionThread.waitForDc(TelegramApi.java:842)
  11524-11580/com.example.tltest W/System.err﹕ at org.telegram.api.engine.TelegramApi$ConnectionThread.run(TelegramApi.java:907)
  11524-11588/com.example.tltest I/System.out﹕ api#1001#Uploader:UploadFileThread iteration
  11524-11580/com.example.tltest W/System.err﹕ Caused by: libcore.io.ErrnoException: socket failed: EACCES (Permission denied)
  11524-11580/com.example.tltest W/System.err﹕ at libcore.io.Posix.socket(Native Method)
  11524-11580/com.example.tltest W/System.err﹕ at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:181)
  11524-11580/com.example.tltest W/System.err﹕ at libcore.io.IoBridge.socket(IoBridge.java:561)
  11524-11580/com.example.tltest W/System.err﹕ ... 7 more
  11524-11580/com.example.tltest I/System.out﹕ TransportRate:onConnectionFailure #1
  11524-11580/com.example.tltest I/System.out﹕ TransportRate:Transport: #1 173.240.5.1:443 #1.0
  11524-11580/com.example.tltest I/System.out﹕ TransportRate:tryConnection #1
  </code></pre>
  
  <p>After connection failure, it tries to connect again and again, but not very successfully. I couldn't find out what's the reason and how to solve this problem. Maybe someone had same problem? Will be very gratefull for some help)  </p>