Servelet
Class TrackerInteract

public class TrackerInteract
implements java.lang.Runnable

Title: Tracker Interact

Description: Creates the Get Request String and calls GetHandler to get the peer list

Copyright: Copyright (c) 2004

Company: CSI5321

Version:
1.0
Author:
Arun Chokkalignam
Field Detail

s

private java.net.Socket s
Creates a request query string and sends it to the tracker using GetHandler
Parameters:
announceURL - String
infoHash - String
Returns:
Vector
Throws:
MalformedURLException -
MalformedURLException -
IOException -

Constructor Detail

TrackerInteract

public TrackerInteract()
Constructor

Method Detail

myGet

public java.util.ArrayList myGet(java.lang.String hostURL,
                                 java.lang.String hostName,
                                 int port,
                                 java.lang.String myParm)
Communicates with the Tracker to get the peer list
Parameters:
hostURL - String
hostName - String
port - int
myParm - String
Returns:
Vector
Throws:
IOException -

trackerCompStopped

public void trackerCompStopped(java.lang.String announceURL,
                               java.lang.String infoHash,
                               java.lang.String event)
This function sends a completed signal to the tracker by computing the values and then calling the sendCompleted
Parameters:
announceURL -
infoHash -
Throws:
MalformedURLException -
UnsupportedEncodingException -
UnknownHostException -
IOException -

sendCompleted

private void sendCompleted(java.lang.String hostURL,
                           java.lang.String hostName,
                           int port,
                           java.lang.String myParm)
This sends a completed get method to the tracker
Parameters:
hostURL -
hostName -
port -
myParm -
Throws:
UnknownHostException -
IOException -

updateTracker

public void updateTracker(java.lang.String announceURL,
                          java.lang.String infoHash)
updates the tracker with the downloads
Parameters:
announceURL -
infoHash -
Throws:
MalformedURLException -
UnsupportedEncodingException -
UnknownHostException -
IOException -

sendUpdate

private void sendUpdate(java.lang.String hostURL,
                        java.lang.String hostName,
                        int port,
                        java.lang.String myParm)
This sends updates to the tracker
Parameters:
hostURL -
hostName -
port -
myParm -
Throws:
UnknownHostException -
IOException -