public class HTTPSocket extends Object
| Constructor and Description |
|---|
HTTPSocket(HTTPSocket socket)
Creates an HTTP socket wrapper around another HTTP socket.
|
HTTPSocket(Socket socket)
Creates an HTTP socket wrapper around a standard socket.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
Closes the socket and all associated streams.
|
InputStream |
getInputStream() |
String |
getLocalAddress()
Gets the local address of this socket.
|
int |
getLocalPort()
Gets the local port of this socket.
|
Socket |
getSocket() |
boolean |
open()
Opens the socket streams for input/output operations.
|
boolean |
post(HTTPResponse httpRes,
long contentOffset,
long contentLength,
boolean isOnlyHeader)
Posts an HTTP response with the specified content parameters.
|
public HTTPSocket(HTTPSocket socket)
socket - HTTP socket to wrappublic HTTPSocket(Socket socket)
socket - underlying socket to wrappublic boolean close()
public InputStream getInputStream()
public String getLocalAddress()
public int getLocalPort()
public Socket getSocket()
public boolean open()
public boolean post(HTTPResponse httpRes, long contentOffset, long contentLength, boolean isOnlyHeader)
httpRes - the HTTP response to postcontentOffset - the offset in the content to start fromcontentLength - the length of content to sendisOnlyHeader - true if only headers should be sent