public class SocketFrameHandler extends Object implements FrameHandler
| Modifier and Type | Field and Description |
|---|---|
static int |
SOCKET_CLOSING_TIMEOUT
Time to linger before closing the socket forcefully.
|
| Constructor and Description |
|---|
SocketFrameHandler(Socket socket) |
SocketFrameHandler(Socket socket,
ExecutorService shutdownExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying data connection (complaint not permitted).
|
void |
flush()
Flush the underlying data connection.
|
InetAddress |
getAddress()
Retrieve address of peer.
|
DataInputStream |
getInputStream() |
InetAddress |
getLocalAddress()
Retrieve the local host.
|
int |
getLocalPort()
Retrieve the local port number.
|
int |
getPort()
Retrieve port number of peer.
|
int |
getTimeout()
Get the underlying socket's read timeout in milliseconds.
|
void |
initialize(AMQConnection connection) |
Frame |
readFrame()
Read a
Frame from the underlying data connection. |
void |
sendHeader()
Send the initial connection header, thus kickstarting the AMQP
protocol version negotiation process and putting the underlying
connection in a state such that the next layer of startup can
proceed.
|
void |
sendHeader(int major,
int minor)
Write a 0-8-style connection header to the underlying socket,
containing the specified version information, kickstarting the
AMQP protocol version negotiation process.
|
void |
sendHeader(int major,
int minor,
int revision)
Write a 0-9-1-style connection header to the underlying socket,
containing the specified version information, kickstarting the
AMQP protocol version negotiation process.
|
void |
setTimeout(int timeoutMs)
Set the underlying socket's read timeout in milliseconds, if applicable.
|
void |
writeFrame(Frame frame)
Write a
Frame to the underlying data connection. |
public static final int SOCKET_CLOSING_TIMEOUT
public SocketFrameHandler(Socket socket) throws IOException
socket - the socket to useIOExceptionpublic SocketFrameHandler(Socket socket, ExecutorService shutdownExecutor) throws IOException
socket - the socket to useIOExceptionpublic InetAddress getAddress()
NetworkConnectiongetAddress in interface NetworkConnectionpublic InetAddress getLocalAddress()
NetworkConnectiongetLocalAddress in interface NetworkConnectionpublic DataInputStream getInputStream()
public int getPort()
NetworkConnectiongetPort in interface NetworkConnectionpublic int getLocalPort()
NetworkConnectiongetLocalPort in interface NetworkConnectionpublic void setTimeout(int timeoutMs)
throws SocketException
FrameHandlersetTimeout in interface FrameHandlertimeoutMs - The timeout in millisecondsSocketExceptionpublic int getTimeout()
throws SocketException
FrameHandlergetTimeout in interface FrameHandlerSocketExceptionpublic void sendHeader(int major,
int minor)
throws IOException
major - major protocol version numberminor - minor protocol version numberIOException - if there is a problem accessing the connectionsendHeader()public void sendHeader(int major,
int minor,
int revision)
throws IOException
major - major protocol version numberminor - minor protocol version numberrevision - protocol revision numberIOException - if there is a problem accessing the connectionsendHeader()public void sendHeader()
throws IOException
FrameHandlersendHeader in interface FrameHandlerIOException - if there is a problem accessing the connectionpublic void initialize(AMQConnection connection)
initialize in interface FrameHandlerpublic Frame readFrame() throws IOException
FrameHandlerFrame from the underlying data connection.readFrame in interface FrameHandlerIOException - if there is a problem accessing the connectionSocketTimeoutException - if the underlying read times outpublic void writeFrame(Frame frame) throws IOException
FrameHandlerFrame to the underlying data connection.writeFrame in interface FrameHandlerframe - the Frame to transmitIOException - if there is a problem accessing the connectionpublic void flush()
throws IOException
FrameHandlerflush in interface FrameHandlerIOException - if there is a problem accessing the connectionpublic void close()
FrameHandlerclose in interface FrameHandlerCopyright © 2021 VMware, Inc. or its affiliates.. All rights reserved.