Tabnine Logo
SessionId.getSessionId
Code IndexAdd Tabnine to your IDE (free)

How to use
getSessionId
method
in
net.i2p.data.i2cp.SessionId

Best Java code snippets using net.i2p.data.i2cp.SessionId.getSessionId (Showing top 8 results out of 315)

origin: i2p/i2p.i2p

/**
 * try hard to make a decent identifier as this will appear in error logs
 */
protected String getPrefix() {
  StringBuilder buf = new StringBuilder();
  buf.append('[');
  buf.append(_state.toString()).append(' ');
  String s = _options.getProperty("inbound.nickname");
  if (s != null)
    buf.append(s);
  else
    buf.append(getClass().getSimpleName());
  SessionId id = _sessionId;
  if (id != null)
    buf.append(" #").append(id.getSessionId());
  buf.append("]: ");
  return buf.toString();
}
origin: i2p/i2p.i2p

  /**
   *  Deliver the message directly, skip notification
   *  @since 0.9.4
   */
  private void sendMessage(long id) throws I2CPMessageException {
    MessagePayloadMessage msg = new MessagePayloadMessage();
    msg.setMessageId(id);
    SessionId sid = _runner.getSessionId(_toDest.calculateHash());
    if (sid == null) {
      if (_log.shouldLog(Log.WARN))
        _log.warn("No session for " + _toDest.calculateHash());
      return;
    }
    msg.setSessionId(sid.getSessionId());
    msg.setPayload(_payload);
    _runner.doSend(msg);
  }
}
origin: i2p/i2p.i2p

/** 
 * Send a notification to the client that their message (id specified) was accepted 
 * for delivery (but not necessarily delivered)
 * Doesn't do anything if i2cp.messageReliability = "none"
 * or if the nonce is 0.
 *
 * @param id OUR id for the message
 * @param nonce HIS id for the message
 */
void ackSendMessage(SessionId sid, MessageId id, long nonce) {
  if (_dontSendMSM || nonce == 0)
    return;
  if (_log.shouldLog(Log.DEBUG))
    _log.debug("Acking message send [accepted]" + id + " / " + nonce + " for sessionId " 
          + sid);
  MessageStatusMessage status = new MessageStatusMessage();
  status.setMessageId(id.getMessageId()); 
  status.setSessionId(sid.getSessionId());
  status.setSize(0L);
  status.setNonce(nonce);
  status.setStatus(MessageStatusMessage.STATUS_SEND_ACCEPTED);
  try {
    doSend(status);
    _acceptedPending.remove(id);
  } catch (I2CPMessageException ime) {
    if (_log.shouldLog(Log.WARN))
      _log.warn("Error writing out the message status message", ime);
  }
}

origin: i2p/i2p.i2p

/**
 * Deliver notification to the client that the given message is available.
 */
private void messageAvailable(MessageId id, long size) throws I2CPMessageException {
  //if (_log.shouldLog(Log.DEBUG))
  //    _log.debug("Sending message available: " + id + " to sessionId " + _runner.getSessionId() 
  //               + " (with nonce=1)", new Exception("available"));
  MessageStatusMessage msg = new MessageStatusMessage();
  msg.setMessageId(id.getMessageId());
  SessionId sid = _runner.getSessionId(_toDest.calculateHash());
  if (sid == null) {
    if (_log.shouldLog(Log.WARN))
      _log.warn("No session for " + _toDest.calculateHash());
    return;
  }
  msg.setSessionId(sid.getSessionId());
  msg.setSize(size);
  // has to be >= 0, it is initialized to -1
  msg.setNonce(1);
  msg.setStatus(MessageStatusMessage.STATUS_AVAILABLE);
  _runner.doSend(msg);
}

origin: i2p/i2p.i2p

if (id == null || id.equals(currId) ||
  (currId == null && id != null && type == SessionStatusMessage.MESSAGE_TYPE) ||
  ((id == null || id.getSessionId() == 65535) &&
   (type == HostReplyMessage.MESSAGE_TYPE || type == DestReplyMessage.MESSAGE_TYPE))) {
origin: i2p/i2p.i2p

msg.setSessionId(_sessId.getSessionId());
origin: i2p/i2p.i2p

/**
 *  No job queue, so super NPEs
 */
@Override
void updateMessageDeliveryStatus(Destination dest, MessageId id, long messageNonce, int status) {
  if (messageNonce <= 0)
    return;
  MessageStatusMessage msg = new MessageStatusMessage();
  msg.setMessageId(id.getMessageId());
  msg.setSessionId(getSessionId(dest.calculateHash()).getSessionId());
  // has to be >= 0, it is initialized to -1
  msg.setNonce(messageNonce);
  msg.setSize(0);
  msg.setStatus(status);
  try {
    doSend(msg);
  } catch (I2CPMessageException ime) {
    _log.warn("Error updating the status for " + id, ime);
  }
}
origin: i2p/i2p.i2p

MessageStatusMessage status = new MessageStatusMessage();
status.setMessageId(_runner.getNextMessageId());
status.setSessionId(sid.getSessionId());
status.setSize(0);
status.setNonce(message.getNonce()); 
net.i2p.data.i2cpSessionIdgetSessionId

Popular methods of SessionId

  • <init>
  • equals
  • readBytes
  • setSessionId
  • writeBytes

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • String (java.lang)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now