当前位置: 首页>>代码示例>>Java>>正文


Java MTProto.getInstanceIndex方法代码示例

本文整理汇总了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();
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:12,代码来源:TcpContext.java

示例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();
    }
}
 
开发者ID:ardock,项目名称:telegram-mt,代码行数:30,代码来源:TcpContext.java

示例3: Scheduller

import org.telegram.mtproto.MTProto; //导入方法依赖的package包/类
public Scheduller(MTProto mtProto, CallWrapper wrapper) {
    this.TAG = "MTProto#" + mtProto.getInstanceIndex() + "#Scheduller";
    this.wrapper = wrapper;
}
 
开发者ID:rubenlagus,项目名称:TelegramApi,代码行数:5,代码来源:Scheduller.java

示例4: Scheduller

import org.telegram.mtproto.MTProto; //导入方法依赖的package包/类
public Scheduller(MTProto mtProto, CallWrapper wrapper) {
    TAG = "MTProto#" + mtProto.getInstanceIndex() + "#Scheduller";
    this.wrapper = wrapper;
}
 
开发者ID:ardock,项目名称:telegram-mt,代码行数:5,代码来源:Scheduller.java


注:本文中的org.telegram.mtproto.MTProto.getInstanceIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。