Transport package

com.github.badoualy.telegram.mtproto.transport

This package handle all the network I/O. As of today, the only protocol implemented is TCP.
In the future it may also contain an HTTP implementation.

MTProtoTcpConnection

This class is implementing a TCP connection using java's nio SocketChannel. The main reason behind this choice was to be able to use Selectors. By doing this, we can listen for messages in n connections in a unique thread, which improves scalability greatly.

Note: In a standard Telegram client, you'll have one main connection, and a few (3 or 4 max) connections to upload/download files.


Did this page help you?