Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed various typos in comments and field names. Fixed Exception for passing comment correctly #286

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions NATS.Client/EncodedConn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ internal EncodedConnection(Options opts)
private IFormatter f = new BinaryFormatter();

// Note, the connection locks around this, so while we are using a
// byte array in the connection, we are still threadsafe.
// byte array in the connection, we are still thread safe.
internal byte[] defaultSerializer(Object obj)
{
byte[] rv = null;
Expand Down Expand Up @@ -143,7 +143,7 @@ internal byte[] defaultSerializer(Object obj)
// it'd be nice to have a default serializer per subscription to avoid
// the lock here, but this mirrors go.
//
// TODO: Look at moving the default to the wrapper and keeping a derialization
// TODO: Look at moving the default to the wrapper and keeping a deserialization
// stream there.
internal object defaultDeserializer(byte[] data)
{
Expand Down Expand Up @@ -182,7 +182,7 @@ private void publishObject(string subject, string reply, object o)
/// <param name="obj">The <see cref="Object"/> to serialize and publish to the connected NATS server.</param>
/// <exception cref="NATSBadSubscriptionException"><paramref name="subject"/> is
/// <c>null</c> or entirely whitespace.</exception>
/// <exception cref="NATSMaxPayloadException">The serialzed form of <paramref name="obj"/> exceeds the maximum payload size
/// <exception cref="NATSMaxPayloadException">The serialized form of <paramref name="obj"/> exceeds the maximum payload size
/// supported by the NATS server.</exception>
/// <exception cref="NATSConnectionClosedException">The <see cref="Connection"/> is closed.</exception>
/// <exception cref="NATSException"><para><see cref="OnSerialize"/> is <c>null</c>.</para>
Expand All @@ -204,7 +204,7 @@ public void Publish(string subject, Object obj)
/// <param name="obj">The <see cref="Object"/> to serialize and publish to the connected NATS server.</param>
/// <exception cref="NATSBadSubscriptionException"><paramref name="subject"/> is <c>null</c> or
/// entirely whitespace.</exception>
/// <exception cref="NATSMaxPayloadException">The serialzed form of <paramref name="obj"/> exceeds the maximum payload size
/// <exception cref="NATSMaxPayloadException">The serialized form of <paramref name="obj"/> exceeds the maximum payload size
/// supported by the NATS server.</exception>
/// <exception cref="NATSConnectionClosedException">The <see cref="Connection"/> is closed.</exception>
/// <exception cref="NATSException"><para><see cref="OnSerialize"/> is <c>null</c>.</para>
Expand Down Expand Up @@ -359,7 +359,7 @@ private object requestObject(string subject, object obj, int timeout)
/// (<c>0</c>).</exception>
/// <exception cref="NATSBadSubscriptionException"><paramref name="subject"/> is <c>null</c> or
/// entirely whitespace.</exception>
/// <exception cref="NATSMaxPayloadException">The serialzed form of <paramref name="obj"/> exceeds the maximum payload size
/// <exception cref="NATSMaxPayloadException">The serialized form of <paramref name="obj"/> exceeds the maximum payload size
/// supported by the NATS server.</exception>
/// <exception cref="NATSConnectionClosedException">The <see cref="Connection"/> is closed.</exception>
/// <exception cref="NATSTimeoutException">A timeout occurred while sending the request or receiving the
Expand Down Expand Up @@ -387,7 +387,7 @@ public object Request(string subject, object obj, int timeout)
/// <returns>A <see cref="Object"/> with the deserialized response from the NATS server.</returns>
/// <exception cref="NATSBadSubscriptionException"><paramref name="subject"/> is <c>null</c> or
/// entirely whitespace.</exception>
/// <exception cref="NATSMaxPayloadException">The serialzed form of <paramref name="obj"/> exceeds the maximum payload size
/// <exception cref="NATSMaxPayloadException">The serialized form of <paramref name="obj"/> exceeds the maximum payload size
/// supported by the NATS server.</exception>
/// <exception cref="NATSConnectionClosedException">The <see cref="Connection"/> is closed.</exception>
/// <exception cref="NATSTimeoutException">A timeout occurred while sending the request or receiving the
Expand Down
2 changes: 1 addition & 1 deletion NATS.Client/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ internal NATSMaxMessagesException() : base("Maximum number of messages have been
public class NATSBadSubscriptionException : NATSException
{
internal NATSBadSubscriptionException() : base("Subscription is not valid.") { }
internal NATSBadSubscriptionException(string s) : base("s") { }
internal NATSBadSubscriptionException(string s) : base(s) { }
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions NATS.Client/IConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public interface IConnection : IDisposable
/// <para>NATS implements a publish-subscribe message distribution model. NATS publish subscribe is a
/// one-to-many communication. A publisher sends a message on a subject. Any active subscriber listening
/// on that subject receives the message. Subscribers can register interest in wildcard subjects.</para>
/// <para>In the basic NATS platfrom, if a subscriber is not listening on the subject (no subject match),
/// or is not acive when the message is sent, the message is not recieved. NATS is a fire-and-forget
/// <para>In the basic NATS platform, if a subscriber is not listening on the subject (no subject match),
/// or is not active when the message is sent, the message is not received. NATS is a fire-and-forget
/// messaging system. If you need higher levels of service, you can either use NATS Streaming, or build the
/// additional reliability into your client(s) yourself.</para>
/// </remarks>
Expand Down
2 changes: 1 addition & 1 deletion NATS.Client/ISubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface ISubscription
/// <item>Wildcards must be separate tokens (<c>foo.*.bar</c> or <c>foo.&gt;</c> are syntactically
/// valid; <c>foo*.bar</c>, <c>f*o.b*r</c> and <c>foo&gt;</c> are not).</item>
/// </list>
/// <para>For example, the wildcard subscrpitions <c>foo.*.quux</c> and <c>foo.&gt;</c> both match
/// <para>For example, the wildcard subscriptions <c>foo.*.quux</c> and <c>foo.&gt;</c> both match
/// <c>foo.bar.quux</c>, but only the latter matches <c>foo.bar.baz</c>. With the full wildcard,
/// it is also possible to express interest in every subject that may exist in NATS (<c>&gt;</c>).</para>
/// </remarks>
Expand Down
6 changes: 3 additions & 3 deletions NATS.Client/Msg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void AssignData(byte[] data)
/// <summary>
/// Gets the <see cref="ISubscription"/> which received the message.
/// </summary>
public ISubscription ArrivalSubcription
public ISubscription ArrivalSubscription
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change to the API (but a very reasonable one). Perhaps we should consider the original misnamed property forwarding to the new property, with the original property marked as Obsolete?

@ColinSullivan1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. Wow, am I embarrassed at that one. Yep, we should keep both, and mark ArrivalSubcription obsolete. We can then remove it for version 1.0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CycoPH, would you mind adding a new property (correcting my spelling), adding an obsolete attribute, e.g.

[ObsoleteAttribute("This property will soon be deprecated. Use ArrivalSubscription instead.")]

...and have the old property call the new one?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure did the change a resubmitted

{
get { return sub; }
}
Expand All @@ -174,7 +174,7 @@ public ISubscription ArrivalSubcription
/// <exception cref="NATSException">
/// <para><see cref="Reply"/> is null or empty.</para>
/// <para>-or-</para>
/// <para><see cref="ArrivalSubcription"/> is null.</para>
/// <para><see cref="ArrivalSubscription"/> is null.</para>
/// </exception>
public void Respond(byte[] data)
{
Expand All @@ -183,7 +183,7 @@ public void Respond(byte[] data)
throw new NATSException("No Reply subject");
}

Connection conn = ArrivalSubcription?.Connection;
Connection conn = ArrivalSubscription?.Connection;
if (conn == null)
{
throw new NATSException("Message is not bound to a subscription");
Expand Down
2 changes: 1 addition & 1 deletion NATS.Client/NATS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ internal get
{
if (signedNonce == null)
{
throw new NATSConnectionException("SignedNonce was not set by the UserSignature event hander.");
throw new NATSConnectionException("SignedNonce was not set by the UserSignature event handler.");
}
return signedNonce;
}
Expand Down
10 changes: 5 additions & 5 deletions NATS.Client/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void SetNkey(string publicNkey, EventHandler<UserSignatureEventArgs> user
/// sign the server nonce.
/// </summary>
/// <param name="publicNkey">The User's public Nkey</param>
/// <param name="privateKeyPath">A path to a file contianing the private Nkey.</param>
/// <param name="privateKeyPath">A path to a file containing the private Nkey.</param>
public void SetNkey(string publicNkey, string privateKeyPath)
{
if (string.IsNullOrWhiteSpace(publicNkey)) throw new ArgumentException("Invalid publicNkey", nameof(publicNkey));
Expand Down Expand Up @@ -462,12 +462,12 @@ public string Token
}

/// <summary>
/// Adds an X.509 certifcate from a file for use with a secure connection.
/// Adds an X.509 certificate from a file for use with a secure connection.
/// </summary>
/// <param name="fileName">Path to the certificate file to add.</param>
/// <exception cref="ArgumentNullException"><paramref name="fileName"/> is <c>null</c>.</exception>
/// <exception cref="System.Security.Cryptography.CryptographicException">An error with the certificate
/// ocurred. For example:
/// occurred. For example:
/// <list>
/// <item>The certificate file does not exist.</item>
/// <item>The certificate is invalid.</item>
Expand All @@ -481,12 +481,12 @@ public void AddCertificate(string fileName)
}

/// <summary>
/// Adds an X.509 certifcate for use with a secure connection.
/// Adds an X.509 certificate for use with a secure connection.
/// </summary>
/// <param name="certificate">An X.509 certificate represented as an <see cref="X509Certificate2"/> object.</param>
/// <exception cref="ArgumentNullException"><paramref name="certificate"/> is <c>null</c>.</exception>
/// <exception cref="System.Security.Cryptography.CryptographicException">An error with the certificate
/// ocurred. For example:
/// occurred. For example:
/// <list>
/// <item>The certificate file does not exist.</item>
/// <item>The certificate is invalid.</item>
Expand Down
6 changes: 3 additions & 3 deletions NATS.Client/ServerPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public int GetHashCode(Srv obj)

// Create the server pool using the options given.
// We will place a Url option first, followed by any
// Server Options. We will randomize the server pool unlesss
// Server Options. We will randomize the server pool unless
// the NoRandomize flag is set.
internal void Setup(Options opts)
{
Expand Down Expand Up @@ -220,7 +220,7 @@ private bool add(Srv s)
}
}

// removes implict servers NOT found in the provided list.
// removes implicit servers NOT found in the provided list.
internal void PruneOutdatedServers(string[] newUrls)
{
LinkedList<string> ulist = new LinkedList<string>(newUrls);
Expand All @@ -235,7 +235,7 @@ internal void PruneOutdatedServers(string[] newUrls)
foreach (Srv s in tmp)
{
// The server returns "<host>:<port>". We can't compare
// againts Uri.Authority becase that API may strip out
// against Uri.Authority because that API may strip out
// ports.
string hp = string.Format("{0}:{1}", s.url.Host, s.url.Port);
if (s.isImplicit && !ulist.Contains(hp) &&
Expand Down
2 changes: 1 addition & 1 deletion NATS.Client/Statistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public long Reconnects
get { return reconnects; }
}

// deep copy contructor
// deep copy constructor
internal Statistics(Statistics obj)
{
this.inMsgs = obj.inMsgs;
Expand Down
2 changes: 1 addition & 1 deletion NATSUnitTests/UnitTestBasic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void TestAsyncSubscribe()
private void CheckReceivedAndValidHandler(object sender, MsgHandlerEventArgs args)
{
Assert.True(compare(args.Message.Data, omsg), "Messages are not equal.");
Assert.Equal(asyncSub, args.Message.ArrivalSubcription);
Assert.Equal(asyncSub, args.Message.ArrivalSubscription);

lock (mu)
{
Expand Down
8 changes: 4 additions & 4 deletions NATSUnitTests/UnitTestConn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public void TestDrain()
c.Drain();

done.WaitOne(5000);
Assert.True(received == expected, string.Format("recieved {0} of {1}", received, expected));
Assert.True(received == expected, string.Format("received {0} of {1}", received, expected));
}
}

Expand Down Expand Up @@ -863,7 +863,7 @@ public void TestDrainAsync()
t.Wait();

done.WaitOne(5000);
Assert.True(received == expected, string.Format("recieved {0} of {1}", received, expected));
Assert.True(received == expected, string.Format("received {0} of {1}", received, expected));
}
}

Expand Down Expand Up @@ -897,7 +897,7 @@ public void TestDrainSub()
s.Drain();

done.WaitOne(5000);
Assert.True(received == expected, string.Format("recieved {0} of {1}", received, expected));
Assert.True(received == expected, string.Format("received {0} of {1}", received, expected));
}
}

Expand Down Expand Up @@ -937,7 +937,7 @@ public void TestDrainSubAsync()
t.Wait();

done.WaitOne(5000);
Assert.True(received == expected, string.Format("recieved {0} of {1}", received, expected));
Assert.True(received == expected, string.Format("received {0} of {1}", received, expected));
}
}

Expand Down