@Deprecated public class SocketHttpServerConnection extends AbstractHttpServerConnection implements HttpInetConnection
Constructor and Description |
---|
SocketHttpServerConnection()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertNotOpen()
Deprecated.
|
protected void |
assertOpen()
Deprecated.
Asserts if the connection is open.
|
protected void |
bind(Socket socket,
HttpParams params)
Deprecated.
Binds this connection to the given
Socket . |
void |
close()
Deprecated.
Closes this connection gracefully.
|
protected SessionInputBuffer |
createSessionInputBuffer(Socket socket,
int bufferSize,
HttpParams params)
Deprecated.
Creates an instance of
SocketInputBuffer to be used for
receiving data from the given Socket . |
protected SessionOutputBuffer |
createSessionOutputBuffer(Socket socket,
int bufferSize,
HttpParams params)
Deprecated.
Creates an instance of
SessionOutputBuffer to be used for
sending data to the given Socket . |
InetAddress |
getLocalAddress()
Deprecated.
|
int |
getLocalPort()
Deprecated.
|
InetAddress |
getRemoteAddress()
Deprecated.
|
int |
getRemotePort()
Deprecated.
|
protected Socket |
getSocket()
Deprecated.
|
int |
getSocketTimeout()
Deprecated.
Returns the socket timeout value.
|
boolean |
isOpen()
Deprecated.
Checks if this connection is open.
|
void |
setSocketTimeout(int timeout)
Deprecated.
Sets the socket timeout value.
|
void |
shutdown()
Deprecated.
Force-closes this connection.
|
String |
toString()
Deprecated.
|
createConnectionMetrics, createEntityDeserializer, createEntitySerializer, createHttpRequestFactory, createRequestParser, createResponseWriter, doFlush, flush, getMetrics, init, isEof, isStale, receiveRequestEntity, receiveRequestHeader, sendResponseEntity, sendResponseHeader
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMetrics, isStale
protected void assertNotOpen()
protected void assertOpen()
AbstractHttpServerConnection
assertOpen
in class AbstractHttpServerConnection
protected SessionInputBuffer createSessionInputBuffer(Socket socket, int bufferSize, HttpParams params) throws IOException
SocketInputBuffer
to be used for
receiving data from the given Socket
.
This method can be overridden in a super class in order to provide
a custom implementation of SessionInputBuffer
interface.
socket
- the socket.bufferSize
- the buffer size.params
- HTTP parameters.IOException
- in case of an I/O error.SocketInputBuffer.SocketInputBuffer(Socket, int, HttpParams)
protected SessionOutputBuffer createSessionOutputBuffer(Socket socket, int bufferSize, HttpParams params) throws IOException
SessionOutputBuffer
to be used for
sending data to the given Socket
.
This method can be overridden in a super class in order to provide
a custom implementation of SocketOutputBuffer
interface.
socket
- the socket.bufferSize
- the buffer size.params
- HTTP parameters.IOException
- in case of an I/O error.SocketOutputBuffer.SocketOutputBuffer(Socket, int, HttpParams)
protected void bind(Socket socket, HttpParams params) throws IOException
Socket
. This socket will be
used by the connection to send and receive data.
This method will invoke createSessionInputBuffer(Socket, int, HttpParams)
and createSessionOutputBuffer(Socket, int, HttpParams)
methods
to create session input / output buffers bound to this socket and then
will invoke AbstractHttpServerConnection.init(SessionInputBuffer, SessionOutputBuffer, HttpParams)
method to pass references to those buffers to the underlying HTTP message
parser and formatter.
After this method's execution the connection status will be reported
as open and the isOpen()
will return true
.
socket
- the socket.params
- HTTP parameters.IOException
- in case of an I/O error.protected Socket getSocket()
public boolean isOpen()
HttpConnection
isOpen
in interface HttpConnection
public InetAddress getLocalAddress()
getLocalAddress
in interface HttpInetConnection
public int getLocalPort()
getLocalPort
in interface HttpInetConnection
public InetAddress getRemoteAddress()
getRemoteAddress
in interface HttpInetConnection
public int getRemotePort()
getRemotePort
in interface HttpInetConnection
public void setSocketTimeout(int timeout)
HttpConnection
setSocketTimeout
in interface HttpConnection
timeout
- timeout value in millisecondspublic int getSocketTimeout()
HttpConnection
getSocketTimeout
in interface HttpConnection
0
if timeout is disabled or -1
if
timeout is undefined.public void shutdown() throws IOException
HttpConnection
shutdown
in interface HttpConnection
IOException
public void close() throws IOException
HttpConnection
shutdown
instead.close
in interface Closeable
close
in interface AutoCloseable
close
in interface HttpConnection
IOException
Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.