Create interface in commonPage edited by Aidan Skinner
At the start of a connection the the NetworkDriver will pass data to a ProtocolFactory which will handle protocol negotiation and return the ProtocolDriver to use or throw an exception if no driver is available. The network driver will call bytesReceived on the ProtocolDriver when data is recieved. Control lies primarily with the network driver. Data comes in from the operating system, is read from the socket by the network driver and given to the protocol drivers bytesReceived method. If the bytes represent the completion of an AMQP frame the ProtocolDriver calls the handler for that frame. The frame handler may request a frame to be written in response, in which case it places the frame in the ProtocolDriver which signals to the NetworkDriver that it has data to be written.
public interface ProtocolDriver
{
int bytesReceived(byte[] bytes, int offset, int length);
byte[] bytesRead();
// Called when the connection has been idle
void idle();
void close();
void halfclose();
// Signal hooks for having data ready to write for the networkdriver
}
public class AMQProtocolDriver implements ProtocolDriver
{
int bytesReceived(byte[] bytes, int offset, int length)
{
// Parses bytes until it figures out which ProtocolDriver to use, constructs one and then passes through all data and other method calls.
}
}
public interface NetworkDriver
{
void open(InetAddress destination);
void bind(int port, InetAddress[] addresses);
void close();
// Returns number of bytes actually accepted
int write(byte[] bytes, int offset, int length);
// Use the preconfigured SSLEngine
void setSSLEngine(SSLEngine engine);
// Taken from Socket
void setKeepAlive(boolean on)
void setOOBInline(boolean on)
void setReceiveBufferSize(int size)
void setReuseAddress(boolean on)
void setSendBufferSize(int size)
void setSoLinger(boolean on, int linger)
void setSoTimeout(int timeout)
void setTcpNoDelay(boolean on)
void setTrafficClass(int tc)
void setReceiveBufferSize(int size);
void setSendBufferSize(int size);
}
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
- [CONF] Apache Qpid > Create interface in common confluence
