CTL.Comm
Class HTTPCommunicator

java.lang.Object
  extended by CTL.Comm.Communicator
      extended by CTL.Comm.HTTPCommunicator

public class HTTPCommunicator
extends Communicator

HTTP protocol communication

See Also:
TCPCommunicator

Field Summary
private  byte[] content
           
private static IPaddr host
           
private static int port
           
private static java.net.ServerSocket ssock
           
private  HURL url
           
 
Constructor Summary
HTTPCommunicator()
           
HTTPCommunicator(java.lang.String u)
           
 
Method Summary
 void accept()
           
 void close()
           
 void connect(PeerID pid)
           
 void listen()
           
 PeerID pid()
           
 byte[] recv()
           
 byte[] recv(long len)
           
 void send(byte[] data, long len, boolean debug)
           
 void setPort(int port)
           
 
Methods inherited from class CTL.Comm.Communicator
notifyErr, send, send, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ssock

private static java.net.ServerSocket ssock

host

private static IPaddr host

port

private static int port

url

private HURL url

content

private byte[] content
Constructor Detail

HTTPCommunicator

public HTTPCommunicator(java.lang.String u)

HTTPCommunicator

public HTTPCommunicator()
Method Detail

setPort

public void setPort(int port)

listen

public void listen()
            throws java.io.IOException
Specified by:
listen in class Communicator
Throws:
java.io.IOException

pid

public PeerID pid()
Specified by:
pid in class Communicator

connect

public void connect(PeerID pid)
             throws java.net.UnknownHostException,
                    java.io.IOException
Specified by:
connect in class Communicator
Throws:
java.net.UnknownHostException
java.io.IOException

accept

public void accept()
            throws java.io.IOException
Specified by:
accept in class Communicator
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in class Communicator
Throws:
java.io.IOException

send

public void send(byte[] data,
                 long len,
                 boolean debug)
          throws java.io.IOException
Specified by:
send in class Communicator
Throws:
java.io.IOException

recv

public byte[] recv(long len)
            throws java.io.IOException
Specified by:
recv in class Communicator
Throws:
java.io.IOException

recv

public byte[] recv()
            throws java.io.IOException
Specified by:
recv in class Communicator
Throws:
java.io.IOException