Order the Book

Class HttpClient

java.lang.Object
  |
  +--NetworkClient
        |
        +--HttpClient

public class HttpClient
extends NetworkClient

The underlying network client used by WebClient.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.


Fields inherited from class NetworkClient
host, port
 
Constructor Summary
HttpClient(String host, int port, String requestLine, String[] requestHeaders, TextArea outputArea, Interruptible app)
           
 
Method Summary
protected  void handleConnection(Socket uriSocket)
          This is the method you will override when making a network client for your task.
 
Methods inherited from class NetworkClient
connect, getHost, getPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClient

public HttpClient(String host,
                  int port,
                  String requestLine,
                  String[] requestHeaders,
                  TextArea outputArea,
                  Interruptible app)
Method Detail

handleConnection

protected void handleConnection(Socket uriSocket)
                         throws IOException
Description copied from class: NetworkClient
This is the method you will override when making a network client for your task. The default version sends a single line ("Generic Network Client") to the server, reads one line of response, prints it, then exits.
Overrides:
handleConnection in class NetworkClient

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive