java.lang.Object | ||
↳ | java.net.Socket | |
↳ | sun.rmi.transport.proxy.HttpReceiveSocket |
The HttpReceiveSocket class extends the WrappedSocket class by removing the HTTP protocol packaging from the input stream and formatting the output stream as an HTTP response. NOTES: The output stream must be explicitly closed for the output to be sent, since the HttpResponseOutputStream needs to buffer the entire transmission to be able to fill in the content-length field of the HTTP header. Closing this socket will do this. The constructor blocks until the HTTP protocol header is received. This could be fixed, but I don't think it should be a problem because this object would not be created unless the HttpAwareServerSocket has detected the beginning of the header anyway, so the rest should be there. This socket can only be used to process one POST and reply to it. Another message would be received on a newly accepted socket anyway.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
in | the input stream to return for socket | ||||||||||
out | the output stream to return for socket | ||||||||||
socket | the underlying concrete socket |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Layer on top of a pre-existing Socket object, and use specified
input and output streams.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Close the socket.
| |||||||||||
Get the address to which this socket is connected.
| |||||||||||
Get an InputStream for this socket.
| |||||||||||
Get the local address to which the socket is bound.
| |||||||||||
Get the local port to which the socket is connected.
| |||||||||||
Get an OutputStream for this socket.
| |||||||||||
Get the remote port to which the socket is connected.
| |||||||||||
Retrive setting for SO_LINGER.
| |||||||||||
Retrive setting for SO_TIMEOUT.
| |||||||||||
Retrieve whether TCP_NODELAY is enabled.
| |||||||||||
Indicate that this socket is not reusable.
| |||||||||||
Enable/disable SO_LINGER with the specified linger time.
| |||||||||||
Enable/disable SO_TIMEOUT with the specified timeout
| |||||||||||
Enable/disable TCP_NODELAY.
| |||||||||||
Return string representation of the socket.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.net.Socket
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
sun.rmi.transport.proxy.RMISocketInfo
|
Layer on top of a pre-existing Socket object, and use specified input and output streams.
socket | the pre-existing socket to use |
---|---|
in | the InputStream to use for this socket (can be null) |
out | the OutputStream to use for this socket (can be null) |
IOException |
---|
Get the address to which this socket is connected. "null" is always returned (to indicate an unknown address) because the originating host's IP address cannot be reliably determined: both because the request probably went through a proxy server, and because if it was delivered by a local forwarder (CGI script or servlet), we do NOT want it to appear as if the call is coming from the local host (in case the remote object makes access control decisions based on the "client host" of a remote call; see bugid 4399040).
null
if the socket is not connected.
Get an InputStream for this socket.
IOException |
---|
Get the local address to which the socket is bound.
InetAddress.anyLocalAddress()
if the socket is not bound yet.Get the local port to which the socket is connected.
Get an OutputStream for this socket.
IOException |
---|
Get the remote port to which the socket is connected.
Retrieve whether TCP_NODELAY is enabled.
boolean
indicating whether or not TCP_NODELAY is enabled.SocketException |
---|
Indicate that this socket is not reusable.
Enable/disable SO_LINGER with the specified linger time.
on | whether or not to linger on. |
---|---|
val | how long to linger for, if on is true. |
SocketException |
---|
Enable/disable SO_TIMEOUT with the specified timeout
timeout | the specified timeout, in milliseconds. |
---|
SocketException |
---|
Enable/disable TCP_NODELAY.
on | true to enable TCP_NODELAY,
false to disable. |
---|
SocketException |
---|
Return string representation of the socket.