Changeset bafec180


Ignore:
Timestamp:
Nov 27, 2015 6:51:59 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
cb979fb
Parents:
5adbf90
Message:

stub out send-with-options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/sam/java/src/net/i2p/sam/SAMMessageSession.java

    r5adbf90 rbafec180  
    2020import net.i2p.client.I2PSessionException;
    2121import net.i2p.client.I2PSessionMuxedListener;
     22import net.i2p.client.SendMessageOptions;
    2223import net.i2p.data.Base64;
    2324import net.i2p.data.DataFormatException;
     
    124125
    125126        return session.sendMessage(d, data, proto, fromPort, toPort);
     127    }
     128
     129    /**
     130     * Actually send bytes through the SAM message-based session I2PSession.
     131     * TODO unused, umimplemented in the sessions and handlers
     132     *
     133     * @param dest Destination
     134     * @param data Bytes to be sent
     135     * @param proto I2CP protocol
     136     * @param fromPort I2CP from port
     137     * @param toPort I2CP to port
     138     *
     139     * @return True if the data was sent, false otherwise
     140     * @throws DataFormatException on unknown / bad dest
     141     * @throws I2PSessionException on serious error, probably session closed
     142     * @since 0.9.24
     143     */
     144    protected boolean sendBytesThroughMessageSession(String dest, byte[] data,
     145                                        int proto, int fromPort, int toPort,
     146                                        boolean sendLeaseSet, int sendTags,
     147                                        int tagThreshold, long expires)
     148                                        throws DataFormatException, I2PSessionException {
     149        Destination d = SAMUtils.getDest(dest);
     150
     151        if (_log.shouldLog(Log.DEBUG)) {
     152            _log.debug("Sending " + data.length + " bytes to " + dest);
     153        }
     154        SendMessageOptions opts = new SendMessageOptions();
     155        opts.setSendLeaseSet(sendLeaseSet);
     156        opts.setTagsToSend(sendTags);
     157        opts.setTagThreshold(tagThreshold);
     158        opts.setDate(expires);
     159
     160        return session.sendMessage(d, data, 0, data.length, proto, fromPort, toPort, opts);
    126161    }
    127162
Note: See TracChangeset for help on using the changeset viewer.