Package com.torrent4j.net.peerwire.messages

Examples of com.torrent4j.net.peerwire.messages.CancelMessage


     
      final byte opcode = buffer.readByte();
      final PeerWireMessage message;
      switch (opcode) {
      case CancelMessage.MESSAGE_ID:
        message = new CancelMessage();
        break;
      case BitFieldMessage.MESSAGE_ID:
        message = new BitFieldMessage();
        break;
      case ChokeMessage.MESSAGE_ID:
View Full Code Here


    write(new RequestMessage(pieceIndex, start, length));
  }

  @Override
  public void cancelRequestedBlock(int pieceIndex, int start, int length) {
    write(new CancelMessage(pieceIndex, start, length));
  }
View Full Code Here

        peer.getStrategy()
            .getUploadStrategy()
            .blockRequested(peer.getTorrent(), block,
                peer.getTorrentPeer());
      } else if (msg instanceof CancelMessage) {
        final CancelMessage message = (CancelMessage) msg;

        final TorrentPiece piece = peer.getTorrent().getPiece(
            message.pieceIndex);
        final TorrentPieceBlock block = piece.getBlock(message.begin,
            message.length);
View Full Code Here

TOP

Related Classes of com.torrent4j.net.peerwire.messages.CancelMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.