CTL.Comm
Class HTTPCommunicator
java.lang.Object
CTL.Comm.Communicator
CTL.Comm.HTTPCommunicator
public class HTTPCommunicator
- extends Communicator
HTTP protocol communication
- See Also:
TCPCommunicator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
HTTPCommunicator
public HTTPCommunicator(java.lang.String u)
HTTPCommunicator
public HTTPCommunicator()
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