fix for: https://issues.apache.org/jira/browse/AMQNET-349
diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs
index 2287f5d..b1af4e0 100644
--- a/src/main/csharp/Connection.cs
+++ b/src/main/csharp/Connection.cs
@@ -20,206 +20,210 @@
namespace Apache.NMS.ZMQ
{
- /// <summary>
- /// Represents a NMS connection ZMQ.
- /// </summary>
- ///
- public class Connection : IConnection
- {
- private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
- private IRedeliveryPolicy redeliveryPolicy;
- private ConnectionMetaData metaData = null;
- private bool closed = true;
- private string clientId;
- private Uri brokerUri;
+ /// <summary>
+ /// Represents a NMS connection ZMQ.
+ /// </summary>
+ ///
+ public class Connection : IConnection
+ {
+ private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
+ private IRedeliveryPolicy redeliveryPolicy;
+ private ConnectionMetaData metaData = null;
+ private bool closed = true;
+ private string clientId;
+ private Uri brokerUri;
- /// <summary>
- /// ZMQ context
- /// </summary>
- static private ZContext _context = new ZContext(1);
+ /// <summary>
+ /// ZMQ context
+ /// </summary>
+ static private ZContext _context = new ZContext(1);
- /// <summary>
- /// Starts message delivery for this connection.
- /// </summary>
- public void Start()
- {
- closed = false;
- }
+ /// <summary>
+ /// Starts message delivery for this connection.
+ /// </summary>
+ public void Start()
+ {
+ closed = false;
+ }
- /// <summary>
- /// This property determines if the asynchronous message delivery of incoming
- /// messages has been started for this connection.
- /// </summary>
- public bool IsStarted
- {
- get { return !closed; }
- }
+ /// <summary>
+ /// This property determines if the asynchronous message delivery of incoming
+ /// messages has been started for this connection.
+ /// </summary>
+ public bool IsStarted
+ {
+ get { return !closed; }
+ }
- /// <summary>
- /// Stop message delivery for this connection.
- /// </summary>
- public void Stop()
- {
- closed = true;
- }
+ /// <summary>
+ /// Stop message delivery for this connection.
+ /// </summary>
+ public void Stop()
+ {
+ closed = true;
+ }
- /// <summary>
- /// Creates a new session to work on this connection
- /// </summary>
- public ISession CreateSession()
- {
- return CreateSession(acknowledgementMode);
- }
+ /// <summary>
+ /// Creates a new session to work on this connection
+ /// </summary>
+ public ISession CreateSession()
+ {
+ return CreateSession(acknowledgementMode);
+ }
- /// <summary>
- /// Creates a new session to work on this connection
- /// </summary>
- public ISession CreateSession(AcknowledgementMode mode)
- {
- return new Session(this, mode);
- }
+ /// <summary>
+ /// Creates a new session to work on this connection
+ /// </summary>
+ public ISession CreateSession(AcknowledgementMode mode)
+ {
+ return new Session(this, mode);
+ }
- public void Dispose()
- {
- Close();
- }
+ public void Dispose()
+ {
+ Close();
+ }
- public void Close()
- {
- Stop();
- }
+ public void Close()
+ {
+ Stop();
+ }
- /// <summary>
- /// The default timeout for network requests.
- /// </summary>
- public TimeSpan RequestTimeout
- {
- get { return NMSConstants.defaultRequestTimeout; }
- set { }
- }
+ public void PurgeTempDestinations()
+ {
+ }
- public AcknowledgementMode AcknowledgementMode
- {
- get { return acknowledgementMode; }
- set { acknowledgementMode = value; }
- }
+ /// <summary>
+ /// The default timeout for network requests.
+ /// </summary>
+ public TimeSpan RequestTimeout
+ {
+ get { return NMSConstants.defaultRequestTimeout; }
+ set { }
+ }
- /// <summary>
- /// Get/or set the broker Uri.
- /// </summary>
- public Uri BrokerUri
- {
- get { return brokerUri; }
- set { brokerUri = value; }
- }
+ public AcknowledgementMode AcknowledgementMode
+ {
+ get { return acknowledgementMode; }
+ set { acknowledgementMode = value; }
+ }
- /// <summary>
- /// Get/or set the client Id
- /// </summary>
- public string ClientId
- {
- get { return clientId; }
- set { clientId = value; }
- }
+ /// <summary>
+ /// Get/or set the broker Uri.
+ /// </summary>
+ public Uri BrokerUri
+ {
+ get { return brokerUri; }
+ set { brokerUri = value; }
+ }
- /// <summary>
- /// Get/or set the redelivery policy for this connection.
- /// </summary>
- public IRedeliveryPolicy RedeliveryPolicy
- {
- get { return this.redeliveryPolicy; }
- set { this.redeliveryPolicy = value; }
- }
+ /// <summary>
+ /// Get/or set the client Id
+ /// </summary>
+ public string ClientId
+ {
+ get { return clientId; }
+ set { clientId = value; }
+ }
- private ConsumerTransformerDelegate consumerTransformer;
- public ConsumerTransformerDelegate ConsumerTransformer
- {
- get { return this.consumerTransformer; }
- set { this.consumerTransformer = value; }
- }
+ /// <summary>
+ /// Get/or set the redelivery policy for this connection.
+ /// </summary>
+ public IRedeliveryPolicy RedeliveryPolicy
+ {
+ get { return this.redeliveryPolicy; }
+ set { this.redeliveryPolicy = value; }
+ }
- private ProducerTransformerDelegate producerTransformer;
- public ProducerTransformerDelegate ProducerTransformer
- {
- get { return this.producerTransformer; }
- set { this.producerTransformer = value; }
- }
+ private ConsumerTransformerDelegate consumerTransformer;
+ public ConsumerTransformerDelegate ConsumerTransformer
+ {
+ get { return this.consumerTransformer; }
+ set { this.consumerTransformer = value; }
+ }
- /// <summary>
- /// Gets ZMQ connection context
- /// </summary>
- static internal ZContext Context
- {
- get { return _context; }
- }
+ private ProducerTransformerDelegate producerTransformer;
+ public ProducerTransformerDelegate ProducerTransformer
+ {
+ get { return this.producerTransformer; }
+ set { this.producerTransformer = value; }
+ }
- /// <summary>
- /// Gets the Meta Data for the NMS Connection instance.
- /// </summary>
- public IConnectionMetaData MetaData
- {
- get { return this.metaData ?? (this.metaData = new ConnectionMetaData()); }
- }
+ /// <summary>
+ /// Gets ZMQ connection context
+ /// </summary>
+ static internal ZContext Context
+ {
+ get { return _context; }
+ }
- /// <summary>
- /// A delegate that can receive transport level exceptions.
- /// </summary>
- public event ExceptionListener ExceptionListener;
+ /// <summary>
+ /// Gets the Meta Data for the NMS Connection instance.
+ /// </summary>
+ public IConnectionMetaData MetaData
+ {
+ get { return this.metaData ?? (this.metaData = new ConnectionMetaData()); }
+ }
- /// <summary>
- /// An asynchronous listener that is notified when a Fault tolerant connection
- /// has been interrupted.
- /// </summary>
- public event ConnectionInterruptedListener ConnectionInterruptedListener;
+ /// <summary>
+ /// A delegate that can receive transport level exceptions.
+ /// </summary>
+ public event ExceptionListener ExceptionListener;
- /// <summary>
- /// An asynchronous listener that is notified when a Fault tolerant connection
- /// has been resumed.
- /// </summary>
- public event ConnectionResumedListener ConnectionResumedListener;
+ /// <summary>
+ /// An asynchronous listener that is notified when a Fault tolerant connection
+ /// has been interrupted.
+ /// </summary>
+ public event ConnectionInterruptedListener ConnectionInterruptedListener;
- public void HandleException(System.Exception e)
- {
- if(ExceptionListener != null && !this.closed)
- {
- ExceptionListener(e);
- }
- else
- {
- Tracer.Error(e);
- }
- }
+ /// <summary>
+ /// An asynchronous listener that is notified when a Fault tolerant connection
+ /// has been resumed.
+ /// </summary>
+ public event ConnectionResumedListener ConnectionResumedListener;
- public void HandleTransportInterrupted()
- {
- Tracer.Debug("Transport has been Interrupted.");
+ public void HandleException(System.Exception e)
+ {
+ if(ExceptionListener != null && !this.closed)
+ {
+ ExceptionListener(e);
+ }
+ else
+ {
+ Tracer.Error(e);
+ }
+ }
- if(this.ConnectionInterruptedListener != null && !this.closed)
- {
- try
- {
- this.ConnectionInterruptedListener();
- }
- catch
- {
- }
- }
- }
+ public void HandleTransportInterrupted()
+ {
+ Tracer.Debug("Transport has been Interrupted.");
- public void HandleTransportResumed()
- {
- Tracer.Debug("Transport has resumed normal operation.");
+ if(this.ConnectionInterruptedListener != null && !this.closed)
+ {
+ try
+ {
+ this.ConnectionInterruptedListener();
+ }
+ catch
+ {
+ }
+ }
+ }
- if(this.ConnectionResumedListener != null && !this.closed)
- {
- try
- {
- this.ConnectionResumedListener();
- }
- catch
- {
- }
- }
- }
- }
+ public void HandleTransportResumed()
+ {
+ Tracer.Debug("Transport has resumed normal operation.");
+
+ if(this.ConnectionResumedListener != null && !this.closed)
+ {
+ try
+ {
+ this.ConnectionResumedListener();
+ }
+ catch
+ {
+ }
+ }
+ }
+ }
}