public class SocketChannelFrameHandler extends Object implements FrameHandler
Constructor and Description |
---|
SocketChannelFrameHandler(SocketChannelFrameHandlerState state) |
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.
|
InetAddress |
getLocalAddress()
Retrieve the local host.
|
int |
getLocalPort()
Retrieve the local port number.
|
int |
getPort()
Retrieve port number of peer.
|
SocketChannelFrameHandlerState |
getState() |
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 |
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 SocketChannelFrameHandler(SocketChannelFrameHandlerState state)
public InetAddress getLocalAddress()
NetworkConnection
getLocalAddress
in interface NetworkConnection
public int getLocalPort()
NetworkConnection
getLocalPort
in interface NetworkConnection
public InetAddress getAddress()
NetworkConnection
getAddress
in interface NetworkConnection
public int getPort()
NetworkConnection
getPort
in interface NetworkConnection
public void setTimeout(int timeoutMs) throws SocketException
FrameHandler
setTimeout
in interface FrameHandler
timeoutMs
- The timeout in millisecondsSocketException
public int getTimeout() throws SocketException
FrameHandler
getTimeout
in interface FrameHandler
SocketException
public void sendHeader() throws IOException
FrameHandler
sendHeader
in interface FrameHandler
IOException
- if there is a problem accessing the connectionpublic void initialize(AMQConnection connection)
initialize
in interface FrameHandler
public Frame readFrame() throws IOException
FrameHandler
Frame
from the underlying data connection.readFrame
in interface FrameHandler
IOException
- if there is a problem accessing the connectionSocketTimeoutException
- if the underlying read times outpublic void writeFrame(Frame frame) throws IOException
FrameHandler
Frame
to the underlying data connection.writeFrame
in interface FrameHandler
frame
- the Frame to transmitIOException
- if there is a problem accessing the connectionpublic void flush() throws IOException
FrameHandler
flush
in interface FrameHandler
IOException
- if there is a problem accessing the connectionpublic void close()
FrameHandler
close
in interface FrameHandler
public SocketChannelFrameHandlerState getState()
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.