本文整理汇总了Java中org.telegram.mtproto.log.Logger.d方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.d方法的具体用法?Java Logger.d怎么用?Java Logger.d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.mtproto.log.Logger
的用法示例。
在下文中一共展示了Logger.d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserializeBody
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void deserializeBody(InputStream stream, TLContext context) throws IOException {
if (this.destClass == null) {
throw new IOException("DestClass not set");
}
int count = readInt(stream);
for (int i = 0; i < count; i++) {
Logger.d("TLVECTOR", "reading: " + i + " from " + count + " (" + this.items.size() + ")" + " --> " + this.destClass);
if (this.destClass == Integer.class) {
this.items.add((T) (Integer) readInt(stream));
} else if (this.destClass == Long.class) {
this.items.add((T) (Long) readLong(stream));
} else if (this.destClass == String.class) {
this.items.add((T) readTLString(stream));
} else {
this.items.add((T) context.deserializeMessage(stream));
}
Logger.d("TLVECTOR", "Extracted " + this.items.get(i).toString());
}
}
示例2: run
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void run() {
setPriority(Thread.MIN_PRIORITY);
while (!MTProto.this.isClosed) {
if (Logger.LOG_THREADS) {
Logger.d(MTProto.this.TAG, "Response Iteration");
}
synchronized (MTProto.this.inQueue) {
if (MTProto.this.inQueue.isEmpty()) {
try {
MTProto.this.inQueue.wait();
} catch (InterruptedException e) {
return;
}
}
if (MTProto.this.inQueue.isEmpty()) {
continue;
}
}
MTMessage message = MTProto.this.inQueue.poll();
onMTMessage(message);
BytesCache.getInstance().put(message.getContent());
}
}
示例3: onChannelBroken
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void onChannelBroken(TcpContext context) {
if (MTProto.this.isClosed) {
return;
}
int contextId = context.getContextId();
Logger.d(MTProto.this.TAG, "onChannelBroken (#" + contextId + ")");
synchronized (MTProto.this.contexts) {
MTProto.this.contexts.remove(context);
if (!MTProto.this.connectedContexts.contains(contextId)) {
if (MTProto.this.contextConnectionId.containsKey(contextId)) {
MTProto.this.exponentalBackoff.onFailureNoWait();
MTProto.this.connectionRate.onConnectionFailure(MTProto.this.contextConnectionId.get(contextId));
}
}
MTProto.this.contexts.notifyAll();
}
MTProto.this.scheduller.onConnectionDies(context.getContextId());
requestSchedule();
}
示例4: suspendConnectionInternal
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
private void suspendConnectionInternal() {
synchronized (timerSync) {
if (reconnectTimer != null) {
reconnectTimer.cancel();
reconnectTimer = null;
}
}
if ((connectionState == ConnectionState.TcpConnectionStageIdle) || (connectionState == ConnectionState.TcpConnectionStageSuspended)) {
return;
}
Logger.d(TcpContext.this.TAG, "suspend connnection " + TcpContext.this);
connectionState = ConnectionState.TcpConnectionStageSuspended;
if (client != null) {
client.removeListener(TcpContext.this);
client.dropConnection();
client = null;
}
callback.onChannelBroken(TcpContext.this);
isFirstPackage = true;
if (restOfTheData != null) {
BuffersStorage.getInstance().reuseFreeBuffer(restOfTheData);
restOfTheData = null;
}
lastPacketLength = 0;
channelToken = 0;
}
示例5: run
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void run() {
setPriority(Thread.MIN_PRIORITY);
while (!isClosed) {
if (Logger.LOG_THREADS) {
Logger.d(TAG, "Response Iteration");
}
synchronized (inQueue) {
if (inQueue.isEmpty()) {
try {
inQueue.wait();
} catch (InterruptedException e) {
return;
}
}
if (inQueue.isEmpty()) {
continue;
}
}
MTMessage message = inQueue.poll();
onMTMessage(message);
BytesCache.getInstance().put(message.getContent());
}
}
示例6: onChannelBroken
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
@Override
public void onChannelBroken(TcpContext context) {
if (isClosed) {
return;
}
int contextId = context.getContextId();
Logger.d(TAG, "onChannelBroken (#" + contextId + ")");
synchronized (contexts) {
contexts.remove(context);
if (!connectedContexts.contains(contextId)) {
if (contextConnectionId.containsKey(contextId)) {
exponentalBackoff.onFailureNoWait();
connectionRate.onConnectionFailure(contextConnectionId.get(contextId));
}
}
contexts.notifyAll();
}
scheduller.onConnectionDies(context.getContextId());
requestSchedule();
}
示例7: skipBytes
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
/**
* Reading bytes from stream
*
* @param count bytes count
* @param stream source stream
* @return readed bytes
* @throws IOException reading exception
*/
//public static void skipBytes(int count, InputStream stream) throws IOException {
// stream.skip(count);
//}
public static void skipBytes(int count, InputStream stream) throws IOException {
byte[] bytes = new byte[count];
stream.read(bytes);
Logger.d("SKIPED", "Skypped " + count + " bytes: " + bytes);
//stream.skip(count);
}
示例8: resendAsNewMessageDelayed
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void resendAsNewMessageDelayed(long msgId, long delay) {
for (SchedullerPackage schedullerPackage : this.messages.values().toArray(new SchedullerPackage[0])) {
if (schedullerPackage.relatedMessageIds.contains(msgId)) {
schedullerPackage.idGenerationTime = 0;
schedullerPackage.dependMessageId = 0;
schedullerPackage.messageId = 0;
schedullerPackage.seqNo = 0;
schedullerPackage.state = STATE_QUEUED;
schedullerPackage.scheduleTime = getCurrentTime() + delay;
Logger.d(this.TAG, "Resending as new #" + schedullerPackage.id);
}
}
}
示例9: onConnectionDies
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public synchronized void onConnectionDies(int connectionId) {
Logger.d(this.TAG, "Connection dies " + connectionId);
for (SchedullerPackage schedullerPackage : this.messages.values().toArray(new SchedullerPackage[0])) {
if (schedullerPackage.writtenToChannel != connectionId) {
continue;
}
if (schedullerPackage.queuedToChannel != -1) {
Logger.d(this.TAG, "Removing: #" + schedullerPackage.id + " " + schedullerPackage.supportTag);
forgetMessage(schedullerPackage.id);
} else {
if (schedullerPackage.isRpc) {
if (schedullerPackage.state == STATE_CONFIRMED || schedullerPackage.state == STATE_QUEUED) {
Logger.d(this.TAG, "Re-schedule: #" + schedullerPackage.id + " " + schedullerPackage.supportTag);
schedullerPackage.state = STATE_QUEUED;
schedullerPackage.lastAttemptTime = 0;
}
} else {
if (schedullerPackage.state == STATE_SENT) {
Logger.d(this.TAG, "Re-schedule: #" + schedullerPackage.id + " " + schedullerPackage.supportTag);
schedullerPackage.state = STATE_QUEUED;
schedullerPackage.lastAttemptTime = 0;
}
}
}
}
}
示例10: sendMessage
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public int sendMessage(TLObject request, long timeout, boolean isRpc, boolean highPriority) {
final int id = this.scheduller.postMessage(request, isRpc, timeout, highPriority);
Logger.d(this.TAG, "sendMessage #" + id + " " + request.toString());
synchronized (this.scheduller) {
this.scheduller.notifyAll();
}
return id;
}
示例11: tryConnection
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public synchronized ConnectionType tryConnection() {
float value = this.rnd.nextFloat();
Transport[] currentTransports = this.transports.values().toArray(new Transport[0]);
Arrays.sort(currentTransports, new Comparator<Transport>() {
@Override
public int compare(Transport transport, Transport transport2) {
return -Float.compare(transport.getRate(), transport2.getRate());
}
});
ConnectionType type = currentTransports[0].getConnectionType();
Logger.d(TAG, "tryConnection #" + type.getId());
return type;
}
示例12: reset
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void reset() {
Logger.d(this.TAG, "reset");
this.currentFailureCount.set(0);
synchronized (this) {
notifyAll();
}
}
示例13: onFailure
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void onFailure() throws InterruptedException {
int val = this.currentFailureCount.incrementAndGet();
if (val > 50) {
this.currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
val = MAX_FAILURE_COUNT;
}
int delay = MIN_DELAY + ((MAX_DELAY - MIN_DELAY) / MAX_FAILURE_COUNT) * val;
synchronized (this) {
Logger.d(this.TAG, "onFailure: wait " + delay + " ms");
wait(delay);
}
}
示例14: onFailureNoWait
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void onFailureNoWait() {
Logger.d(this.TAG, "onFailureNoWait");
int val = this.currentFailureCount.incrementAndGet();
if (val > 50) {
this.currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
val = MAX_FAILURE_COUNT;
}
}
示例15: resendAsNewMessageDelayed
import org.telegram.mtproto.log.Logger; //导入方法依赖的package包/类
public void resendAsNewMessageDelayed(long msgId, int delay) {
for (SchedullerPackage schedullerPackage : messages.values().toArray(new SchedullerPackage[0])) {
if (schedullerPackage.relatedMessageIds.contains(msgId)) {
schedullerPackage.idGenerationTime = 0;
schedullerPackage.dependMessageId = 0;
schedullerPackage.messageId = 0;
schedullerPackage.seqNo = 0;
schedullerPackage.state = STATE_QUEUED;
schedullerPackage.scheduleTime = getCurrentTime() + delay;
Logger.d(TAG, "Resending as new #" + schedullerPackage.id);
}
}
}