本文整理汇总了Java中org.telegram.mtproto.MTProto.getInstanceIndex方法的典型用法代码示例。如果您正苦于以下问题:Java MTProto.getInstanceIndex方法的具体用法?Java MTProto.getInstanceIndex怎么用?Java MTProto.getInstanceIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.mtproto.MTProto
的用法示例。
在下文中一共展示了MTProto.getInstanceIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TcpContext
import org.telegram.mtproto.MTProto; //导入方法依赖的package包/类
public TcpContext(MTProto proto, String ip, int port, TcpContextCallback callback) {
this.contextId = contextLastId.incrementAndGet();
this.connectionState = ConnectionState.TcpConnectionStageIdle;
this.TAG = "MTProto#" + proto.getInstanceIndex() + "#Transport" + this.contextId;
this.ip = ip;
this.port = port;
this.callback = callback;
this.selector = new PyroSelector();
this.selector.spawnNetworkThread("Selector Thread");
BuffersStorage.getInstance();
}
示例2: TcpContext
import org.telegram.mtproto.MTProto; //导入方法依赖的package包/类
public TcpContext(MTProto proto, String ip, int port, boolean checksum, TcpContextCallback callback) throws IOException {
try {
this.contextId = contextLastId.incrementAndGet();
this.TAG = "MTProto#" + proto.getInstanceIndex() + "#Transport" + contextId;
this.ip = ip;
this.port = port;
this.useChecksum = checksum;
this.socket = new Socket();
this.socket.connect(new InetSocketAddress(ip, port), CONNECTION_TIMEOUT);
this.socket.setKeepAlive(true);
this.socket.setTcpNoDelay(true);
if (!useChecksum) {
socket.getOutputStream().write(0xef);
}
this.isClosed = false;
this.isBroken = false;
this.callback = callback;
this.readerThread = new ReaderThread();
this.writerThread = new WriterThread();
this.dieThread = new DieThread();
this.readerThread.start();
this.writerThread.start();
this.dieThread.start();
} catch (IOException e) {
throw e;
} catch (Throwable t) {
throw new IOException();
}
}
示例3: Scheduller
import org.telegram.mtproto.MTProto; //导入方法依赖的package包/类
public Scheduller(MTProto mtProto, CallWrapper wrapper) {
this.TAG = "MTProto#" + mtProto.getInstanceIndex() + "#Scheduller";
this.wrapper = wrapper;
}
示例4: Scheduller
import org.telegram.mtproto.MTProto; //导入方法依赖的package包/类
public Scheduller(MTProto mtProto, CallWrapper wrapper) {
TAG = "MTProto#" + mtProto.getInstanceIndex() + "#Scheduller";
this.wrapper = wrapper;
}