mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jcduff
23.04.2008 b4f8838b15342670c31753a484abf0129e3c9653
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/SocketSession.java
@@ -41,7 +41,7 @@
/**
 * This class Implement a protocol session using a basic socket and relying on
 * the innate encoding/decoding capabilities of the ReplicationMessage
 * the innate encoding/decoding capabilities of the ReplicationMsg
 * by using the getBytes() and generateMsg() methods of those classes.
 */
public class SocketSession implements ProtocolSession
@@ -101,10 +101,19 @@
  /**
   * {@inheritDoc}
   */
  public synchronized void publish(ReplicationMessage msg)
  public synchronized void publish(ReplicationMsg msg)
         throws IOException
  {
    byte[] buffer = msg.getBytes();
    publish(msg, ProtocolVersion.getCurrentVersion());
  }
  /**
   * {@inheritDoc}
   */
  public synchronized void publish(ReplicationMsg msg, short reqProtocolVersion)
         throws IOException
  {
    byte[] buffer = msg.getBytes(reqProtocolVersion);
    String str = String.format("%08x", buffer.length);
    if (debugEnabled())
@@ -124,8 +133,9 @@
  /**
   * {@inheritDoc}
   */
  public ReplicationMessage receive() throws IOException,
      ClassNotFoundException, DataFormatException
  public ReplicationMsg receive() throws IOException,
      ClassNotFoundException, DataFormatException,
      NotSupportedOldVersionPDUException
  {
    /* Read the first 8 bytes containing the packet length */
    int length = 0;
@@ -161,7 +171,7 @@
      /* We do not want the heartbeat to close the session when */
      /* we are processing a message even a time consuming one. */
      lastReceiveTime=0;
      return ReplicationMessage.generateMsg(buffer);
      return ReplicationMsg.generateMsg(buffer);
    }
    catch (OutOfMemoryError e)
    {