public class

SocketFrameHandler

extends Object
implements FrameHandler
java.lang.Object
   ↳ com.rabbitmq.client.impl.SocketFrameHandler

Class Overview

A socket-based frame handler.

Summary

Constants
int SOCKET_CLOSING_TIMEOUT Time to linger before closing the socket forcefully.
Public Constructors
SocketFrameHandler(Socket socket)
Public Methods
void close()
Close the underlying data connection (complaint not permitted).
InetAddress getAddress()
Retrieve address of peer.
DataInputStream getInputStream()
int getPort()
Retrieve port number of peer.
int getTimeout()
Get the underlying socket's read timeout in milliseconds.
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, 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 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 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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.rabbitmq.client.impl.FrameHandler

Constants

public static final int SOCKET_CLOSING_TIMEOUT

Time to linger before closing the socket forcefully.

Constant Value: 1 (0x00000001)

Public Constructors

public SocketFrameHandler (Socket socket)

Parameters
socket the socket to use
Throws
IOException

Public Methods

public void close ()

Close the underlying data connection (complaint not permitted).

public InetAddress getAddress ()

Retrieve address of peer.

public DataInputStream getInputStream ()

public int getPort ()

Retrieve port number of peer.

public int getTimeout ()

Get the underlying socket's read timeout in milliseconds.

Returns
  • The timeout in milliseconds

public Frame readFrame ()

Read a Frame from the underlying data connection.

Returns
  • an incoming Frame, or null if there is none
Throws
IOException

public 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.

Throws
IOException

public 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.

Parameters
major major protocol version number
minor minor protocol version number
revision protocol revision number
Throws
IOException if there is a problem accessing the connection
See Also

public 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.

Parameters
major major protocol version number
minor minor protocol version number
Throws
IOException if there is a problem accessing the connection
See Also

public void setTimeout (int timeoutMs)

Set the underlying socket's read timeout in milliseconds, if applicable.

Parameters
timeoutMs The timeout in milliseconds

public void writeFrame (Frame frame)

Write a Frame to the underlying data connection.

Parameters
frame the Frame to transmit
Throws
IOException