Package com.rabbitmq.client.impl
Interface FrameHandler
- All Superinterfaces:
NetworkConnection
- All Known Implementing Classes:
SocketChannelFrameHandler
,SocketFrameHandler
Interface to a frame handler.
Concurrency
Implementations must be thread-safe, and not allow frames to be interleaved, either while reading or writing.-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the underlying data connection (complaint not permitted).void
flush()
Flush the underlying data connection.int
Get the underlying socket's read timeout in milliseconds.void
initialize
(AMQConnection connection) Read aFrame
from the underlying data connection.void
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
setTimeout
(int timeoutMs) Set the underlying socket's read timeout in milliseconds, if applicable.void
writeFrame
(Frame frame) Write aFrame
to the underlying data connection.Methods inherited from interface com.rabbitmq.client.impl.NetworkConnection
getAddress, getLocalAddress, getLocalPort, getPort
-
Method Details
-
setTimeout
Set the underlying socket's read timeout in milliseconds, if applicable.- Parameters:
timeoutMs
- The timeout in milliseconds- Throws:
SocketException
-
getTimeout
Get the underlying socket's read timeout in milliseconds.- Returns:
- The timeout in milliseconds
- Throws:
SocketException
-
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.- Throws:
IOException
- if there is a problem accessing the connection
-
initialize
-
readFrame
Read aFrame
from the underlying data connection.- Returns:
- an incoming Frame, or null if there is none
- Throws:
IOException
- if there is a problem accessing the connectionSocketTimeoutException
- if the underlying read times out
-
writeFrame
Write aFrame
to the underlying data connection.- Parameters:
frame
- the Frame to transmit- Throws:
IOException
- if there is a problem accessing the connection
-
flush
Flush the underlying data connection.- Throws:
IOException
- if there is a problem accessing the connection
-
close
void close()Close the underlying data connection (complaint not permitted).
-